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

Method setNodeValue

lib/tiny-graph.js:121–133  ·  view source on GitHub ↗
(x, v)

Source from the content-addressed store, hash-verified

119 }
120
121 setNodeValue (x, v) {
122 const n = this.nodes[x];
123
124 v = defined(v) ? v : null;
125
126 if (n) {
127 n.value = v;
128 } else {
129 this.nodes[x] = node(v);
130 }
131
132 return true;
133 }
134
135 toJSON (space = 0) {
136 return JSON.stringify(this.nodes, null, space);

Callers

nothing calls this directly

Calls 2

definedFunction · 0.70
nodeFunction · 0.70

Tested by

no test coverage detected