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

Method setNodeValue

src/graph.js:101–113  ·  view source on GitHub ↗
(x, v)

Source from the content-addressed store, hash-verified

99 }
100
101 setNodeValue (x, v) {
102 const n = this.nodes[x];
103
104 v = defined(v) ? v : null;
105
106 if (n) {
107 n.value = v;
108 } else {
109 this.nodes[x] = node(v);
110 }
111
112 return true;
113 }
114
115 toJSON (space = 0) {
116 return JSON.stringify(this.nodes, null, space);

Callers 1

graph.jsFile · 0.45

Calls 2

definedFunction · 0.70
nodeFunction · 0.70

Tested by

no test coverage detected