aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2022-10-09 22:15:14 +0200
committerVendicated <vendicated@riseup.net>2022-10-09 22:15:23 +0200
commitf875d63c6d1f4ccd4d81a15e900259a45486ba3f (patch)
tree53c76fb181806c84ca52605b40e296954c398b70
parente7fb4ebd4eac99ca7b937c954d3b052f68627c57 (diff)
downloadVencord-f875d63c6d1f4ccd4d81a15e900259a45486ba3f.tar.gz
Vencord-f875d63c6d1f4ccd4d81a15e900259a45486ba3f.tar.bz2
Vencord-f875d63c6d1f4ccd4d81a15e900259a45486ba3f.zip
Fix webpack search
-rw-r--r--src/webpack/webpack.ts5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/webpack/webpack.ts b/src/webpack/webpack.ts
index f1fea46..ca987d0 100644
--- a/src/webpack/webpack.ts
+++ b/src/webpack/webpack.ts
@@ -59,7 +59,7 @@ export function find(filter: FilterFn, getDefault = true) {
// is 3 is the longest obfuscated export?
// the length check makes search about 20% faster
- for (const nestedMod in mod.exports) if (nestedMod.length < 3) {
+ for (const nestedMod in mod.exports) if (nestedMod.length <= 3) {
const nested = mod.exports[nestedMod];
if (nested && filter(nested)) return nested;
}
@@ -68,7 +68,6 @@ export function find(filter: FilterFn, getDefault = true) {
return null;
}
-// TODO fix
export function findAll(filter: FilterFn, getDefault = true) {
if (typeof filter !== "function") throw new Error("Invalid filter. Expected a function got " + typeof filter);
@@ -84,7 +83,7 @@ export function findAll(filter: FilterFn, getDefault = true) {
if (mod.exports.default && filter(mod.exports.default))
ret.push(getDefault ? mod.exports.default : mod.exports);
- else for (const nestedMod in mod.exports) if (nestedMod.length < 3) {
+ else for (const nestedMod in mod.exports) if (nestedMod.length <= 3) {
const nested = mod.exports[nestedMod];
if (nested && filter(nested)) ret.push(nested);
}