Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@snyk/dep-graph

Package Overview
Dependencies
Maintainers
1
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@snyk/dep-graph - npm Package Compare versions

Comparing version 1.27.0 to 1.27.1

1

dist/core/dep-graph.d.ts

@@ -18,3 +18,2 @@ import * as graphlib from '../graphlib';

private _countNodePathsToRootCache;
private _pathsToRootCache;
private _hasCycles;

@@ -21,0 +20,0 @@ constructor(_graph: graphlib.Graph, _rootNodeId: NodeId, _pkgs: Record<PkgId, types.PkgInfo>, _pkgNodes: Record<PkgId, Set<NodeId>>, _pkgManager: types.PkgManager);

@@ -14,3 +14,2 @@ "use strict";

this._countNodePathsToRootCache = new Map();
this._pathsToRootCache = new Map();
this._rootPkgId = _graph.node(_rootNodeId).pkgId;

@@ -223,20 +222,12 @@ this._pkgList = Object.values(_pkgs);

pathsFromNodeToRoot(nodeId, ancestors = []) {
if (this._pathsToRootCache.has(nodeId)) {
return this._pathsToRootCache.get(nodeId);
}
const parentNodesIds = this.getNodeParentsNodeIds(nodeId);
const pkgInfo = this.getNodePkg(nodeId);
if (parentNodesIds.length === 0) {
const result = [[pkgInfo]];
this._pathsToRootCache.set(nodeId, result);
return result;
return [[pkgInfo]];
}
const allPaths = [];
ancestors = ancestors.concat(nodeId);
let shouldMemoize = true;
for (const id of parentNodesIds) {
if (ancestors.includes(id)) {
shouldMemoize = false;
if (ancestors.includes(id))
continue;
}
const pathToRoot = this.pathsFromNodeToRoot(id, ancestors).map((path) => [pkgInfo].concat(path));

@@ -247,5 +238,2 @@ for (const path of pathToRoot) {

}
if (shouldMemoize) {
this._pathsToRootCache.set(nodeId, allPaths);
}
return allPaths;

@@ -252,0 +240,0 @@ }

2

package.json

@@ -71,3 +71,3 @@ {

},
"version": "1.27.0"
"version": "1.27.1"
}

Sorry, the diff of this file is not supported yet

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