feat(Webpack): Add $$vencordPatchedSource to patched factories
This commit is contained in:
parent
eaca14bb5a
commit
051bce89f8
1 changed files with 5 additions and 1 deletions
|
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue