@buggyorg/graphtools
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -38,4 +38,9 @@ 'use strict'; | ||
/** | ||
* returns all pathes tracked by the path that defines the ports. | ||
* The path will be pointing to node (node will be the last item of the result) | ||
* it follows the direction of the directed edges | ||
*/ | ||
function walkBack(graph, node, path) { | ||
return generalWalk(graph, node, path, predecessor); | ||
return _lodash2.default.map(generalWalk(graph, node, path, predecessor), _lodash2.default.reverse); | ||
} | ||
@@ -42,0 +47,0 @@ |
{ | ||
"name": "@buggyorg/graphtools", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Tools for processing buggy graphs.", | ||
@@ -5,0 +5,0 @@ "main": "lib/api.js", |
@@ -20,4 +20,9 @@ | ||
/** | ||
* returns all pathes tracked by the path that defines the ports. | ||
* The path will be pointing to node (node will be the last item of the result) | ||
* it follows the direction of the directed edges | ||
*/ | ||
export function walkBack (graph, node, path) { | ||
return generalWalk(graph, node, path, predecessor) | ||
return _.map(generalWalk(graph, node, path, predecessor), _.reverse) | ||
} | ||
@@ -24,0 +29,0 @@ |
@@ -85,3 +85,3 @@ /* global describe, it */ | ||
expect(path).to.have.length(1) | ||
expect(path[0]).to.deep.equal(['2_STDOUT', '1_INC', '0_STDIN']) | ||
expect(path[0]).to.deep.equal(['0_STDIN', '1_INC', '2_STDOUT']) | ||
}) | ||
@@ -110,4 +110,4 @@ | ||
expect(path).to.have.length(2) | ||
expect(path[0][1]).to.be.oneOf(['1_INC', '4_CONST1']) | ||
expect(path[1][1]).to.be.oneOf(['1_INC', '4_CONST1']) | ||
expect(path[0][0]).to.be.oneOf(['1_INC', '4_CONST1']) | ||
expect(path[1][0]).to.be.oneOf(['1_INC', '4_CONST1']) | ||
}) | ||
@@ -143,5 +143,5 @@ | ||
expect(path).to.have.length(2) | ||
expect(path[0][1]).to.be.oneOf(['1_INC', '4_CONST1']) | ||
expect(path[1][1]).to.be.oneOf(['1_INC', '4_CONST1']) | ||
expect(path[0][0]).to.be.oneOf(['1_INC', '4_CONST1']) | ||
expect(path[1][0]).to.be.oneOf(['1_INC', '4_CONST1']) | ||
}) | ||
}) |
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
23252
348
0