From f875d63c6d1f4ccd4d81a15e900259a45486ba3f Mon Sep 17 00:00:00 2001 From: Vendicated Date: Sun, 9 Oct 2022 22:15:14 +0200 Subject: Fix webpack search --- src/webpack/webpack.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') 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); } -- cgit