MCPcopy Index your code
hub / github.com/avoidwork/tiny-graph / add

Method add

lib/tiny-graph.js:26–35  ·  view source on GitHub ↗
(x, y)

Source from the content-addressed store, hash-verified

24 }
25
26 add (x, y) {
27 let result = false;
28
29 if (defined(this.nodes[x]) && defined(this.nodes[y])) {
30 this.nodes[x].edges[y] = this.nodes[y].edges[x] = null;
31 result = true;
32 }
33
34 return result;
35 }
36
37 adjacent (x, y) {
38 const n = this.nodes[x];

Callers

nothing calls this directly

Calls 1

definedFunction · 0.70

Tested by

no test coverage detected