Comparing version 4.2.0 to 4.3.0
@@ -54,2 +54,3 @@ var path = require('path'); // if module is locally defined we path.resolve it | ||
var mod = require.resolve(moduleName); | ||
var visited = {}; | ||
@@ -61,12 +62,9 @@ // Check if the module has been resolved and found within | ||
// Recursively go over the results | ||
(function run(mod) { | ||
(function run(current) { | ||
visited[current.id] = true; | ||
// Go over each of the module's children and | ||
// run over it | ||
mod.children.forEach(function (child) { | ||
// Prevent infinite recursion | ||
/* istanbul ignore next */ | ||
if (child.parent === mod) { | ||
return; | ||
} else { | ||
run(child); | ||
current.children.forEach(function (child) { | ||
if (!visited[child.id]) { | ||
run(child); | ||
} | ||
@@ -77,3 +75,3 @@ }); | ||
// found module | ||
callback(mod); | ||
callback(current); | ||
})(mod); | ||
@@ -80,0 +78,0 @@ } |
{ | ||
"name": "decache", | ||
"version": "4.2.0", | ||
"version": "4.3.0", | ||
"description": "decache (Delete Cache) lets you delete modules from node.js require() cache; useful when testing your modules/projects.", | ||
@@ -5,0 +5,0 @@ "main": "decache.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9370
161