@snyk/dep-graph
Advanced tools
Comparing version 2.2.0 to 2.3.0
@@ -42,2 +42,3 @@ import * as graphlib from '../graphlib'; | ||
countPathsToRoot(pkg: types.Pkg): number; | ||
isTransitive(pkg: types.Pkg): boolean; | ||
equals(other: types.DepGraph, { compareRoot }?: { | ||
@@ -44,0 +45,0 @@ compareRoot?: boolean; |
@@ -113,2 +113,10 @@ "use strict"; | ||
} | ||
isTransitive(pkg) { | ||
const checking = new Set(this.getPkgNodeIds(pkg)); | ||
for (const directDep of this.getNodeDepsNodeIds(this.rootNodeId)) { | ||
if (checking.has(directDep)) | ||
return false; | ||
} | ||
return true; | ||
} | ||
equals(other, { compareRoot = true } = {}) { | ||
@@ -115,0 +123,0 @@ let otherDepGraph; |
@@ -64,2 +64,3 @@ export interface Pkg { | ||
}): PkgInfo[][]; | ||
isTransitive(pkg: Pkg): boolean; | ||
directDepsLeadingTo(pkg: Pkg): PkgInfo[]; | ||
@@ -66,0 +67,0 @@ countPathsToRoot(pkg: Pkg): number; |
@@ -70,3 +70,3 @@ { | ||
}, | ||
"version": "2.2.0" | ||
"version": "2.3.0" | ||
} |
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
118891
1787