read-installed
Advanced tools
Comparing version 2.0.0 to 2.0.1
{ | ||
"name": "read-installed", | ||
"description": "Read all the installed packages in a folder, and return a tree structure with all the data.", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"repository": { | ||
@@ -6,0 +6,0 @@ "type": "git", |
@@ -129,2 +129,3 @@ | ||
resolveInheritance(obj, opts) | ||
markExtraneous(obj) | ||
cb(null, obj) | ||
@@ -316,4 +317,2 @@ }) | ||
found.invalid = true | ||
} else { | ||
found.extraneous = false | ||
} | ||
@@ -342,4 +341,2 @@ deps[d] = found | ||
dependency.extraneous = false | ||
if (!semver.satisfies(dependency.version, peerDeps[d], true)) { | ||
@@ -353,2 +350,24 @@ dependency.peerInvalid = true | ||
function recursivelyMarkExtraneous (obj, extraneous) { | ||
// stop recursion if we're not changing anything | ||
if (obj.extraneous === extraneous) return | ||
obj.extraneous = extraneous | ||
var deps = obj.dependencies = obj.dependencies || {} | ||
Object.keys(deps).forEach(function(d){ | ||
recursivelyMarkExtraneous(deps[d], extraneous) | ||
}); | ||
} | ||
function markExtraneous (obj) { | ||
// start from the root object and mark as non-extraneous all modules that haven't been previously flagged as | ||
// extraneous then propagate to all their dependencies | ||
var deps = obj.dependencies = obj.dependencies || {} | ||
Object.keys(deps).forEach(function(d){ | ||
if (!deps[d].extraneous){ | ||
recursivelyMarkExtraneous(deps[d], false); | ||
} | ||
}); | ||
} | ||
function copy (obj) { | ||
@@ -355,0 +374,0 @@ if (!obj || typeof obj !== 'object') return obj |
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
19670
14
488