MCPcopy Index your code
hub / github.com/hizzgdev/jsmind / set_root

Method set_root

src/jsmind.mind.js:50–59  ·  view source on GitHub ↗

* Set the root node, only once. * @param {string} node_id * @param {string} topic * @param {Record =} data * @returns {Node | null}

(node_id, topic, data)

Source from the content-addressed store, hash-verified

48 * @returns {Node | null}
49 */
50 set_root(node_id, topic, data) {
51 if (this.root == null) {
52 this.root = new Node(node_id, 0, topic, data, true);
53 this._put_node(this.root);
54 return this.root;
55 } else {
56 logger.error('root node is already exist');
57 return null;
58 }
59 }
60 /**
61 * Add a child node under parent.
62 * @param {Node} parent_node

Callers 6

jsmind.jsFile · 0.80
jsmind.format.jsFile · 0.80
jsmind.test.jsFile · 0.80
create_fake_mindFunction · 0.80

Calls 1

_put_nodeMethod · 0.95

Tested by 1

create_fake_mindFunction · 0.64