Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "graphlib", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "A directed multi-graph library", | ||
"main": "graphlib.js", | ||
"main": "index.js", | ||
"keywords": [ | ||
@@ -10,2 +10,3 @@ "graph" | ||
"devDependencies": { | ||
"browserify": "2.28.x", | ||
"chai": "1.7.x", | ||
@@ -18,3 +19,3 @@ "mocha": "1.12.x", | ||
"type": "git", | ||
"url": "https://github.com/cpettitt/dagre.git" | ||
"url": "https://github.com/cpettitt/graphlib.git" | ||
}, | ||
@@ -21,0 +22,0 @@ "license": "MIT", |
var assert = require("chai").assert, | ||
Graph = require("../graphlib").Graph; | ||
Graph = require("../lib/Graph"); | ||
@@ -97,2 +97,40 @@ describe("Graph", function() { | ||
describe("sources", function() { | ||
it("returns all nodes for a graph with no edges", function() { | ||
var g = new Graph(); | ||
g.addNode("a"); | ||
g.addNode("b"); | ||
g.addNode("c"); | ||
assert.deepEqual(g.sources().sort(), ["a", "b", "c"]); | ||
}); | ||
it("returns only nodes that have no in-edges", function() { | ||
var g = new Graph(); | ||
g.addNode("a"); | ||
g.addNode("b"); | ||
g.addNode("c"); | ||
g.addEdge(null, "a", "b"); | ||
assert.deepEqual(g.sources().sort(), ["a", "c"]); | ||
}); | ||
}); | ||
describe("sinks", function() { | ||
it("returns all nodes for a graph with no edges", function() { | ||
var g = new Graph(); | ||
g.addNode("a"); | ||
g.addNode("b"); | ||
g.addNode("c"); | ||
assert.deepEqual(g.sinks().sort(), ["a", "b", "c"]); | ||
}); | ||
it("returns only nodes that have no out-edges", function() { | ||
var g = new Graph(); | ||
g.addNode("a"); | ||
g.addNode("b"); | ||
g.addNode("c"); | ||
g.addEdge(null, "a", "b"); | ||
assert.deepEqual(g.sinks().sort(), ["b", "c"]); | ||
}); | ||
}); | ||
describe("edge", function() { | ||
@@ -99,0 +137,0 @@ it("throws if the edge isn't in the graph", function() { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
33224
17
859
4
1
1