@pnpm/deps.graph-sequencer
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -83,2 +83,3 @@ "use strict"; | ||
const cycleVisited = new Set(); | ||
const cycles = []; | ||
while (queue.length) { | ||
@@ -88,3 +89,5 @@ const [id, cycle] = queue.shift(); | ||
if (to === startNode) { | ||
return cycle; | ||
cycleVisited.add(to); | ||
cycles.push([...cycle]); | ||
continue; | ||
} | ||
@@ -98,3 +101,7 @@ if (visited.has(to) || cycleVisited.has(to)) { | ||
} | ||
return []; | ||
if (!cycles.length) { | ||
return []; | ||
} | ||
cycles.sort((a, b) => b.length - a.length); | ||
return cycles[0]; | ||
} | ||
@@ -101,0 +108,0 @@ } |
{ | ||
"name": "@pnpm/deps.graph-sequencer", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Sort items in a graph using a topological sort", | ||
@@ -27,3 +27,3 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"@pnpm/deps.graph-sequencer": "2.0.0" | ||
"@pnpm/deps.graph-sequencer": "2.0.1" | ||
}, | ||
@@ -30,0 +30,0 @@ "exports": { |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
10553
125
0