Skip to content

Commit

Permalink
only consider whitelisted submodule if not root module
Browse files Browse the repository at this point in the history
  • Loading branch information
pgayvallet committed Mar 12, 2024
1 parent 8871cfa commit dd6a011
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dd6a011

Please sign in to comment.