feat(Webpack): Add $$vencordPatchedSource to patched factories

This commit is contained in:
Nuckyz 2024-08-18 00:26:40 -03:00
parent eaca14bb5a
commit 051bce89f8
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9

View file

@ -233,7 +233,7 @@ function patchFactories(factories: Record<string, (module: any, exports: any, re
logger.error("Error while firing callback for Webpack subscription:\n", err, filter, callback); logger.error("Error while firing callback for Webpack subscription:\n", err, filter, callback);
} }
} }
} as any as { toString: () => string, original: any, (...args: any[]): void; }; } as any as { toString: () => string, original: any, (...args: any[]): void; $$vencordPatchedSource?: string; };
factory.toString = originalMod.toString.bind(originalMod); factory.toString = originalMod.toString.bind(originalMod);
factory.original = originalMod; factory.original = originalMod;
@ -354,5 +354,9 @@ function patchFactories(factories: Record<string, (module: any, exports: any, re
if (!patch.all) patches.splice(i--, 1); if (!patch.all) patches.splice(i--, 1);
} }
if (IS_DEV && mod !== originalMod) {
factory.$$vencordPatchedSource = String(mod);
}
} }
} }