Comparing version 2.0.1 to 2.0.2
@@ -9,3 +9,3 @@ | ||
module.exports = function(edges){ | ||
module.exports = function(edges) { | ||
return toposort(uniqueNodes(edges), edges) | ||
@@ -25,2 +25,9 @@ } | ||
// check for unknown nodes | ||
edges.forEach(function(edge) { | ||
if (!nodesHash.has(edge[0]) || !nodesHash.has(edge[1])) { | ||
throw new Error('Unknown node. There is an unknown node in the supplied edges.') | ||
} | ||
}) | ||
while (i--) { | ||
@@ -27,0 +34,0 @@ if (!visited[i]) visit(nodes[i], i, new Set()) |
{ | ||
"name": "toposort", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Topological sort of directed ascyclic graphs (like dependecy lists)", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -85,3 +85,3 @@ var vows = require('vows') | ||
{ topic: function() { | ||
return toposort.array(['bla'] | ||
return toposort.array(['bla'], | ||
[ ["foo", 'bar'] | ||
@@ -88,0 +88,0 @@ , ["bar", "ron"] |
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
16683
276