ngraph.graph
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -20,3 +20,3 @@ /** | ||
var nodes = {}, | ||
var nodes = typeof Object.create === 'function' ? Object.create(null) : {}, | ||
links = [], | ||
@@ -264,6 +264,4 @@ // Hash of multi-edges. Used to track ids of edges between same nodes | ||
for (node in nodes) { | ||
if (nodes.hasOwnProperty(node)) { | ||
if (callback(nodes[node])) { | ||
return; // client doesn't want to proceed. return. | ||
} | ||
if (callback(nodes[node])) { | ||
return; // client doesn't want to proceed. return. | ||
} | ||
@@ -270,0 +268,0 @@ } |
{ | ||
"name": "ngraph.graph", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Base graph structure in ngraph.*", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
ngraph.graph | ||
============ | ||
[Graph](http://en.wikipedia.org/wiki/Graph_(mathematics\)) data structure for ngraph.\*. Library implements API to modify graph structure and supports event-driven notifications when graph changes. | ||
[Graph](http://en.wikipedia.org/wiki/Graph_\(mathematics\)) data structure for ngraph.\*. Library implements API to modify graph structure and supports event-driven notifications when graph changes. | ||
@@ -6,0 +6,0 @@ [![build status](https://secure.travis-ci.org/anvaka/ngraph.graph.png)](http://travis-ci.org/anvaka/ngraph.graph) |
@@ -17,2 +17,17 @@ var test = require('tap').test, | ||
test('add nodeid same as a prototype property', function (t) { | ||
var graph = createGraph(); | ||
graph.addNode('constructor'); | ||
graph.addLink('watch', 'constructor'); | ||
var iterated = 0; | ||
graph.forEachNode(function () { | ||
iterated += 1; | ||
}); | ||
t.ok(graph.hasLink('watch', 'constructor')); | ||
t.equal(iterated, 2, 'has two nodes'); | ||
t.end(); | ||
}); | ||
test('add link adds link', function(t) { | ||
@@ -19,0 +34,0 @@ var graph = createGraph(); |
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
25069
485