From f4cc95da5a0edf7491e58aca6c0ac7c78bbd7acb Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Fri, 31 May 2024 05:29:01 -0300 Subject: [PATCH] Use indexOf in more places --- src/webpack/webpack.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/webpack/webpack.ts b/src/webpack/webpack.ts index f31855870..af57a324e 100644 --- a/src/webpack/webpack.ts +++ b/src/webpack/webpack.ts @@ -48,7 +48,7 @@ export const filters = { if (typeof m !== "function") return false; const s = Function.prototype.toString.call(m); for (const c of code) { - if (!s.includes(c)) return false; + if (s.indexOf(c) === -1) return false; } return true; }, @@ -229,7 +229,7 @@ export const findModuleId = traceFunction("findModuleId", function findModuleId( const str = String(wreq.m[id]); for (const c of code) { - if (!str.includes(c)) continue outer; + if (str.indexOf(c) === -1) continue outer; } return id; } @@ -526,7 +526,7 @@ export function search(...filters: Array) { const factory = factories[id]; const factoryStr = String(factory); for (const filter of filters) { - if (typeof filter === "string" && !factoryStr.includes(filter)) continue outer; + if (typeof filter === "string" && factoryStr.indexOf(filter) === -1) continue outer; if (filter instanceof RegExp && !filter.test(factoryStr)) continue outer; } results[id] = factory;