Socket
Socket
Sign inDemoInstall

read-installed

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

read-installed - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

test/extraneous.js

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc