aboutsummaryrefslogtreecommitdiff
path: root/src/webpack/webpack.ts
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2022-09-27 16:57:46 +0200
committerVendicated <vendicated@riseup.net>2022-09-27 16:57:46 +0200
commit572bfcee6ce343c6bf9d69262576de4e57c01500 (patch)
treea0cdf027c41152a45183e80344d054071684a064 /src/webpack/webpack.ts
parent6398dd25d20e6bc3e02425b709233066baf64e0c (diff)
downloadVencord-572bfcee6ce343c6bf9d69262576de4e57c01500.tar.gz
Vencord-572bfcee6ce343c6bf9d69262576de4e57c01500.tar.bz2
Vencord-572bfcee6ce343c6bf9d69262576de4e57c01500.zip
Fix Settings UI
Diffstat (limited to 'src/webpack/webpack.ts')
-rw-r--r--src/webpack/webpack.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/webpack/webpack.ts b/src/webpack/webpack.ts
index a1fd2fb..b8f10e4 100644
--- a/src/webpack/webpack.ts
+++ b/src/webpack/webpack.ts
@@ -10,7 +10,15 @@ export const filters = {
props.length === 1
? m => m[props[0]] !== void 0
: m => props.every(p => m[p] !== void 0),
- byDisplayName: (deezNuts: string): FilterFn => m => m.default?.displayName === deezNuts
+ byDisplayName: (deezNuts: string): FilterFn => m => m.default?.displayName === deezNuts,
+ byCode: (...code: string[]): FilterFn => m => {
+ if (typeof m !== "function") return false;
+ const s = Function.prototype.toString.call(m);
+ for (const c of code) {
+ if (!s.includes(c)) return false;
+ }
+ return true;
+ }
};
export const subscriptions = new Map<FilterFn, CallbackFn>();