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

Method delNode

lib/tiny-graph.js:60–74  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

58 }
59
60 delNode (x) {
61 const n = this.nodes[x];
62 let result = false;
63
64 if (defined(n)) {
65 Object.keys(n.edges).forEach(y => {
66 delete this.nodes[y].edges[x];
67 });
68
69 delete this.nodes[x];
70 result = true;
71 }
72
73 return result;
74 }
75
76 fromJSON (arg) {
77 this.nodes = JSON.parse(arg);

Callers

nothing calls this directly

Calls 1

definedFunction · 0.70

Tested by

no test coverage detected