From c8be34857029b6d2bc789cd8f85df6fa40b533d2 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Sun, 26 Nov 2023 00:33:41 -0300 Subject: [PATCH] fix findModuleId --- src/webpack/webpack.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/webpack/webpack.ts b/src/webpack/webpack.ts index 0d8c432d..7a98f123 100644 --- a/src/webpack/webpack.ts +++ b/src/webpack/webpack.ts @@ -218,14 +218,14 @@ export const findBulk = traceFunction("findBulk", function findBulk(...filterFns * @returns string or null */ export const findModuleId = traceFunction("findModuleId", function findModuleId(...code: string[]) { - const filter = filters.byCode(...code); - + outer: for (const id in wreq.m) { - const mod = wreq.m[id]; + const str = wreq.m[id].toString(); - if (filter(mod)) { - return id; + for (const c of code) { + if (!str.includes(c)) continue outer; } + return id; } const err = new Error("Didn't find module with code(s):\n" + code.join("\n"));