From dd6a011a71f71321cdce6f6c9b599f6011a2e8b8 Mon Sep 17 00:00:00 2001 From: pgayvallet Date: Tue, 12 Mar 2024 09:04:48 +0100 Subject: [PATCH] only consider whitelisted submodule if not root module --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index f03e2cb..b8abe41 100644 --- a/index.js +++ b/index.js @@ -231,7 +231,7 @@ function Hook (modules, options, onrequire) { return exports } - if (modules.includes(fullModuleName)) { + if (modules.includes(fullModuleName) && moduleName !== fullModuleName) { // if we get to this point, it means that we're requiring a whitelisted sub-module moduleName = fullModuleName isWhitelistedSubmodule = true