Comparing version 0.5.4 to 0.5.5
@@ -0,1 +1,7 @@ | ||
v0.5.5 | ||
====== | ||
* Rely less on instanceof checks which may fail with different versions of the | ||
library loaded. | ||
v0.5.4 | ||
@@ -2,0 +8,0 @@ ====== |
@@ -21,3 +21,3 @@ var Set = require("../data/Set"); | ||
if (g.isDirected()) { | ||
throw new Error("components cannot be used with a directed graph"); | ||
throw new Error("components can only be applied to an undirected graph. Bad input: " + g); | ||
} | ||
@@ -24,0 +24,0 @@ |
@@ -39,3 +39,3 @@ var PriorityQueue = require("../data/PriorityQueue"), | ||
weightFunc = weightFunc || function() { return 1; }; | ||
incidentFunc = incidentFunc || (g instanceof Digraph | ||
incidentFunc = incidentFunc || (g.isDirected() | ||
? function(u) { return g.outEdges(u); } | ||
@@ -42,0 +42,0 @@ : function(u) { return g.incidentEdges(u); }); |
@@ -39,3 +39,3 @@ var Digraph = require("../Digraph"); | ||
weightFunc = weightFunc || function() { return 1; }; | ||
incidentFunc = incidentFunc || (g instanceof Digraph | ||
incidentFunc = incidentFunc || (g.isDirected() | ||
? function(u) { return g.outEdges(u); } | ||
@@ -42,0 +42,0 @@ : function(u) { return g.incidentEdges(u); }); |
@@ -23,4 +23,4 @@ var Digraph = require("../Digraph"); | ||
function tarjan(g) { | ||
if (!(g instanceof Digraph)) { | ||
throw new Error("tarjan can only be applied to a Digraph. Bad input: " + g); | ||
if (!g.isDirected()) { | ||
throw new Error("tarjan can only be applied to a directed graph. Bad input: " + g); | ||
} | ||
@@ -27,0 +27,0 @@ |
@@ -18,4 +18,4 @@ var Digraph = require("../Digraph"); | ||
function topsort(g) { | ||
if (!(g instanceof Digraph)) { | ||
throw new Error("topsort can only be applied to a Digraph. Bad input: " + g); | ||
if (!g.isDirected()) { | ||
throw new Error("topsort can only be applied to a directed graph. Bad input: " + g); | ||
} | ||
@@ -22,0 +22,0 @@ |
@@ -118,3 +118,4 @@ var util = require("../util"); | ||
Set.prototype.intersect = function(other) { | ||
if (!(other instanceof Set)) { | ||
// If the other Set does not look like a Set... | ||
if (!other.keys) { | ||
other = new Set(other); | ||
@@ -121,0 +122,0 @@ } |
@@ -1,1 +0,1 @@ | ||
module.exports = '0.5.4'; | ||
module.exports = '0.5.5'; |
{ | ||
"name": "graphlib", | ||
"version": "0.5.4", | ||
"version": "0.5.5", | ||
"description": "A directed and undirected multi-graph library", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
56962
1466