Closed lyxsus closed 7 years ago
Merging #20 into master will decrease coverage by
0.68%
. The diff coverage is93.33%
.
@@ Coverage Diff @@
## master #20 +/- ##
==========================================
- Coverage 99.21% 98.52% -0.69%
==========================================
Files 5 5
Lines 127 136 +9
==========================================
+ Hits 126 134 +8
- Misses 1 2 +1
Impacted Files | Coverage Δ | |
---|---|---|
libs/Graph.js | 100% <100%> (ø) |
:arrow_up: |
libs/toDeepMap.js | 95.65% <87.5%> (-4.35%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 2de3f87...24e3875. Read the comment docs.
Thanks for your contribution. Unfortunately, I need to decline this PR as this change is not necessary:
Starting from version v2.5.0
, you can pass the constructor a Map
directly. This allows you to use Symbols (or anything, really) as keys:
const Graph = require('node-dijkstra');
const A = Symbol('A');
const B = Symbol('B');
const C = Symbol('C');
const a = new Map();
a.set(B, 1);
a.set(C, 2);
const b = new Map();
b.set(A, 2);
const graph = new Map();
graph.set(A, a);
graph.set(B, b);
const route = new Graph(graph);
route.path(A, B);
See in REPL. (You can also add one node at a time. Example)