graphology
Advanced tools
Comparing version 0.24.0 to 0.24.1
{ | ||
"name": "graphology", | ||
"version": "0.24.0", | ||
"version": "0.24.1", | ||
"description": "A robust and multipurpose Graph object for JavaScript.", | ||
@@ -5,0 +5,0 @@ "main": "dist/graphology.cjs.js", |
@@ -800,29 +800,29 @@ "use strict"; | ||
_assert["default"].deepStrictEqual(loopy.edges('n'), ['e1', 'e2', 'e3']); | ||
_assert["default"].deepStrictEqual(loopy.edges('n'), ['e2', 'e1', 'e3']); | ||
_assert["default"].deepStrictEqual(loopy.outboundEdges('n'), ['e1', 'e2', 'e3']); | ||
_assert["default"].deepStrictEqual(loopy.outboundEdges('n'), ['e2', 'e1', 'e3']); | ||
_assert["default"].deepStrictEqual(loopy.inboundEdges('n'), ['e1', 'e2', 'e3']); | ||
_assert["default"].deepStrictEqual(loopy.inboundEdges('n'), ['e2', 'e1', 'e3']); | ||
_assert["default"].deepStrictEqual(loopy.outEdges('n'), ['e1', 'e2']); | ||
_assert["default"].deepStrictEqual(loopy.outEdges('n'), ['e2', 'e1']); | ||
_assert["default"].deepStrictEqual(loopy.inEdges('n'), ['e1', 'e2']); | ||
_assert["default"].deepStrictEqual(loopy.inEdges('n'), ['e2', 'e1']); | ||
_assert["default"].deepStrictEqual(loopy.undirectedEdges('n'), ['e3']); | ||
_assert["default"].deepStrictEqual(loopy.directedEdges('n'), ['e1', 'e2']); | ||
_assert["default"].deepStrictEqual(loopy.directedEdges('n'), ['e2', 'e1']); | ||
_assert["default"].deepStrictEqual(loopy.edges('n', 'n'), ['e1', 'e2', 'e3']); | ||
_assert["default"].deepStrictEqual(loopy.edges('n', 'n'), ['e2', 'e1', 'e3']); | ||
_assert["default"].deepStrictEqual(loopy.outboundEdges('n', 'n'), ['e1', 'e2', 'e3']); | ||
_assert["default"].deepStrictEqual(loopy.outboundEdges('n', 'n'), ['e2', 'e1', 'e3']); | ||
_assert["default"].deepStrictEqual(loopy.inboundEdges('n', 'n'), ['e1', 'e2', 'e3']); | ||
_assert["default"].deepStrictEqual(loopy.inboundEdges('n', 'n'), ['e2', 'e1', 'e3']); | ||
_assert["default"].deepStrictEqual(loopy.outEdges('n', 'n'), ['e1', 'e2']); | ||
_assert["default"].deepStrictEqual(loopy.outEdges('n', 'n'), ['e2', 'e1']); | ||
_assert["default"].deepStrictEqual(loopy.inEdges('n', 'n'), ['e1', 'e2']); | ||
_assert["default"].deepStrictEqual(loopy.inEdges('n', 'n'), ['e2', 'e1']); | ||
_assert["default"].deepStrictEqual(loopy.undirectedEdges('n', 'n'), ['e3']); | ||
_assert["default"].deepStrictEqual(loopy.directedEdges('n', 'n'), ['e1', 'e2']); // Iterators | ||
_assert["default"].deepStrictEqual(loopy.directedEdges('n', 'n'), ['e2', 'e1']); // Iterators | ||
@@ -836,29 +836,29 @@ | ||
_assert["default"].deepStrictEqual(mapKeys(loopy.edgeEntries('n')), ['e1', 'e2', 'e3']); | ||
_assert["default"].deepStrictEqual(mapKeys(loopy.edgeEntries('n')), ['e2', 'e1', 'e3']); | ||
_assert["default"].deepStrictEqual(mapKeys(loopy.outboundEdgeEntries('n')), ['e1', 'e2', 'e3']); | ||
_assert["default"].deepStrictEqual(mapKeys(loopy.outboundEdgeEntries('n')), ['e2', 'e1', 'e3']); | ||
_assert["default"].deepStrictEqual(mapKeys(loopy.inboundEdgeEntries('n')), ['e1', 'e2', 'e3']); | ||
_assert["default"].deepStrictEqual(mapKeys(loopy.inboundEdgeEntries('n')), ['e2', 'e1', 'e3']); | ||
_assert["default"].deepStrictEqual(mapKeys(loopy.outEdgeEntries('n')), ['e1', 'e2']); | ||
_assert["default"].deepStrictEqual(mapKeys(loopy.outEdgeEntries('n')), ['e2', 'e1']); | ||
_assert["default"].deepStrictEqual(mapKeys(loopy.inEdgeEntries('n')), ['e1', 'e2']); | ||
_assert["default"].deepStrictEqual(mapKeys(loopy.inEdgeEntries('n')), ['e2', 'e1']); | ||
_assert["default"].deepStrictEqual(mapKeys(loopy.undirectedEdgeEntries('n')), ['e3']); | ||
_assert["default"].deepStrictEqual(mapKeys(loopy.directedEdgeEntries('n')), ['e1', 'e2']); | ||
_assert["default"].deepStrictEqual(mapKeys(loopy.directedEdgeEntries('n')), ['e2', 'e1']); | ||
_assert["default"].deepStrictEqual(mapKeys(loopy.edgeEntries('n', 'n')), ['e1', 'e2', 'e3']); | ||
_assert["default"].deepStrictEqual(mapKeys(loopy.edgeEntries('n', 'n')), ['e2', 'e1', 'e3']); | ||
_assert["default"].deepStrictEqual(mapKeys(loopy.outboundEdgeEntries('n', 'n')), ['e1', 'e2', 'e3']); | ||
_assert["default"].deepStrictEqual(mapKeys(loopy.outboundEdgeEntries('n', 'n')), ['e2', 'e1', 'e3']); | ||
_assert["default"].deepStrictEqual(mapKeys(loopy.inboundEdgeEntries('n', 'n')), ['e1', 'e2', 'e3']); | ||
_assert["default"].deepStrictEqual(mapKeys(loopy.inboundEdgeEntries('n', 'n')), ['e2', 'e1', 'e3']); | ||
_assert["default"].deepStrictEqual(mapKeys(loopy.outEdgeEntries('n', 'n')), ['e1', 'e2']); | ||
_assert["default"].deepStrictEqual(mapKeys(loopy.outEdgeEntries('n', 'n')), ['e2', 'e1']); | ||
_assert["default"].deepStrictEqual(mapKeys(loopy.inEdgeEntries('n', 'n')), ['e1', 'e2']); | ||
_assert["default"].deepStrictEqual(mapKeys(loopy.inEdgeEntries('n', 'n')), ['e2', 'e1']); | ||
_assert["default"].deepStrictEqual(mapKeys(loopy.undirectedEdgeEntries('n', 'n')), ['e3']); | ||
_assert["default"].deepStrictEqual(mapKeys(loopy.directedEdgeEntries('n', 'n')), ['e1', 'e2']); | ||
_assert["default"].deepStrictEqual(mapKeys(loopy.directedEdgeEntries('n', 'n')), ['e2', 'e1']); | ||
}, | ||
@@ -865,0 +865,0 @@ 'findOutboundEdge should work on multigraphs (#319).': function findOutboundEdgeShouldWorkOnMultigraphs319() { |
@@ -48,24 +48,43 @@ "use strict"; | ||
_assert["default"].deepStrictEqual(graph.neighbors('B'), []); | ||
} // 'copy of the graph should work even with edge wrangling.': function () { | ||
// const graph = new Graph(); | ||
// graph.addNode('n0'); | ||
// graph.addNode('n1'); | ||
// graph.addNode('n2'); | ||
// graph.addNode('n3'); | ||
// graph.addEdge('n0', 'n1'); | ||
// graph.addEdge('n1', 'n2'); | ||
// graph.addEdge('n2', 'n3'); | ||
// graph.addEdge('n3', 'n0'); | ||
// // Surgery | ||
// const newNode = 'n12'; | ||
// graph.addNode(newNode); | ||
// const e = graph.edge('n1', 'n2'); | ||
// graph.dropEdge(e); | ||
// graph.addEdge('n1', newNode); | ||
// graph.addEdgeWithKey(e, newNode, 'n2'); | ||
// console.log(graph); | ||
// const copy = graph.copy(); | ||
// assert.strictEqual(graph.size, copy.size); | ||
// } | ||
}, | ||
'exhaustive deletion use-cases should not break doubly-linked lists implementation of multigraph edge storage.': function exhaustiveDeletionUseCasesShouldNotBreakDoublyLinkedListsImplementationOfMultigraphEdgeStorage() { | ||
var graph = new Graph({ | ||
multi: true | ||
}); | ||
graph.mergeEdgeWithKey('1', 'A', 'B'); | ||
graph.mergeEdgeWithKey('2', 'A', 'B'); | ||
graph.mergeEdgeWithKey('3', 'A', 'B'); | ||
graph.mergeEdgeWithKey('4', 'A', 'B'); | ||
graph.dropEdge('1'); | ||
graph.dropEdge('2'); | ||
graph.dropEdge('3'); | ||
graph.dropEdge('4'); | ||
_assert["default"].strictEqual(graph.size, 0); | ||
_assert["default"].strictEqual(graph.areNeighbors('A', 'B'), false); | ||
graph.mergeEdgeWithKey('1', 'A', 'B'); | ||
graph.mergeEdgeWithKey('2', 'A', 'B'); | ||
graph.mergeEdgeWithKey('3', 'A', 'B'); | ||
graph.mergeEdgeWithKey('4', 'A', 'B'); | ||
_assert["default"].strictEqual(graph.size, 4); | ||
_assert["default"].strictEqual(graph.areNeighbors('A', 'B'), true); | ||
graph.dropEdge('2'); | ||
graph.dropEdge('3'); | ||
_assert["default"].strictEqual(graph.size, 2); | ||
_assert["default"].strictEqual(graph.areNeighbors('A', 'B'), true); | ||
graph.dropEdge('4'); | ||
graph.dropEdge('1'); | ||
_assert["default"].strictEqual(graph.size, 0); | ||
_assert["default"].strictEqual(graph.areNeighbors('A', 'B'), false); | ||
} | ||
}, | ||
@@ -72,0 +91,0 @@ 'Key coercion': { |
@@ -679,3 +679,3 @@ "use strict"; | ||
}, | ||
'it should also work with mied, multi graphs and self loops.': function itShouldAlsoWorkWithMiedMultiGraphsAndSelfLoops() { | ||
'it should also work with mixed, multi graphs and self loops.': function itShouldAlsoWorkWithMixedMultiGraphsAndSelfLoops() { | ||
var graph = new Graph({ | ||
@@ -682,0 +682,0 @@ multi: true |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
863063
20502