Comparing version 2.0.1 to 2.0.2
{ | ||
"name": "cortez2", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "A node module providing some basic data structures with pure js implementation", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -1,2 +0,2 @@ | ||
module.exports = (frontierManager) => (isGoal, startNodeId, graph) => { | ||
module.exports = (frontierManager) => (isGoal, startNodeId, graph, expand) => { | ||
const discovered = {}; | ||
@@ -14,3 +14,3 @@ const fm = frontierManager(); | ||
graph.getEdgesFrom(last).forEach((edgeId) => { | ||
expand(last).forEach((edgeId) => { | ||
const edge = graph.edges[edgeId]; | ||
@@ -17,0 +17,0 @@ if (!discovered[edge.targetId]) { |
@@ -37,3 +37,3 @@ const graph = require('./index'); | ||
const g = buildGraph(); | ||
const path = dfs((nodeId) => nodeId % 3 === 2, 0, g).map((edge) => edge.targetId); | ||
const path = dfs((nodeId) => nodeId % 3 === 2, 0, g, g.getEdgesFrom).map((edge) => edge.targetId); | ||
expect(path).toEqual([0, 3, 6, 11]); | ||
@@ -44,4 +44,4 @@ }); | ||
const g = buildGraph(); | ||
const path = bfs((nodeId) => nodeId % 3 == 2, 0, g).map((edge) => edge.targetId); | ||
const path = bfs((nodeId) => nodeId % 3 == 2, 0, g, g.getEdgesFrom).map((edge) => edge.targetId); | ||
expect(path).toEqual([0, 2]); | ||
}); |
@@ -52,2 +52,3 @@ const sequence = require('../sequence'); | ||
const getEdgesFrom = (nodeId) => outbound[nodeId] || new Set(); | ||
const getEdges = (nodeId) => new Set([...getEdgesTo(nodeId), ...getEdgesFrom(nodeId)]); | ||
@@ -104,2 +105,3 @@ const disconnectNode = (nodeId) => { | ||
getEdgesFrom, | ||
getEdges, | ||
disconnectNode, | ||
@@ -106,0 +108,0 @@ removeNode, |
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
21151
533