@tangle/graph
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -24,3 +24,3 @@ const { LinkMap, BacklinkMap } = require('./maps') | ||
.map(node => node.key) | ||
if (this.rootKeys.length === 0) error('at least one root node') | ||
if (this.nodes.length && this.rootKeys.length === 0) error('at least one root node') | ||
@@ -27,0 +27,0 @@ if (containsSelfLoop(this.nodes, this._getBacklinks)) throw new Error('there is a selfloop in nodes') |
{ | ||
"name": "@tangle/graph", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "a helper for building + updating traverseable tangle graphs", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
const test = require('tape') | ||
const Graph = require('..') | ||
test('Graph with nodes []', t => { | ||
const graph = new Graph([]) | ||
t.true(graph, 'can create graph') | ||
t.deepEqual(graph.rootNodes, [], 'has no rootNodes') | ||
t.deepEqual(graph.rootNodeKeys, [], 'has no rootNodes') | ||
t.end() | ||
}) | ||
// A (root) | ||
@@ -5,0 +15,0 @@ // / \ |
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
43482
1099