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

Method add

src/graph.js:6–15  ·  view source on GitHub ↗
(x, y)

Source from the content-addressed store, hash-verified

4 }
5
6 add (x, y) {
7 let result = false;
8
9 if (defined(this.nodes[x]) && defined(this.nodes[y])) {
10 this.nodes[x].edges[y] = this.nodes[y].edges[x] = null;
11 result = true;
12 }
13
14 return result;
15 }
16
17 adjacent (x, y) {
18 const n = this.nodes[x];

Callers 1

graph.jsFile · 0.45

Calls 1

definedFunction · 0.70

Tested by

no test coverage detected