dependency-graph
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -5,2 +5,6 @@ # Dependency Graph Changelog | ||
## 0.2.1 (July 3, 2015) | ||
- Fixed removeNode leaving references in outgoingEdges and reference to non-existent var edges - thanks [juhoha](https://github.com/juhoha)! (Fixes #2) | ||
## 0.2.0 (May 1, 2015) | ||
@@ -7,0 +11,0 @@ |
@@ -53,8 +53,10 @@ /** | ||
delete this.incomingEdges[name]; | ||
Object.keys(this.incomingEdges).forEach(function (key) { | ||
var idx = this.incomingEdges[key].indexOf(name); | ||
if (idx >= 0) { | ||
edges.splice(idx, 1); | ||
} | ||
}, this); | ||
[this.incomingEdges, this.outgoingEdges].forEach(function (edgeList) { | ||
Object.keys(edgeList).forEach(function (key) { | ||
var idx = edgeList[key].indexOf(name); | ||
if (idx >= 0) { | ||
edgeList[key].splice(idx, 1); | ||
} | ||
}, this); | ||
}); | ||
}, | ||
@@ -61,0 +63,0 @@ hasNode:function (name) { |
{ | ||
"name": "dependency-graph", | ||
"description": "Simple dependency graph.", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"author": "Jim Riecken <jriecken@gmail.com>", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
@@ -117,2 +117,18 @@ var DepGraph = require('../lib/dep_graph').DepGraph; | ||
it('should still work after nodes are removed', function () { | ||
var graph = new DepGraph(); | ||
graph.addNode('a'); | ||
graph.addNode('b'); | ||
graph.addNode('c'); | ||
graph.addDependency('a', 'b'); | ||
graph.addDependency('b', 'c'); | ||
expect(graph.dependenciesOf('a')).toEqual(['c', 'b']); | ||
graph.removeNode('c'); | ||
expect(graph.dependenciesOf('a')).toEqual(['b']); | ||
}); | ||
}); |
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
11282
227