MCPcopy Create free account
hub / github.com/culvertsoft/mgen / treeIndexSet

Function treeIndexSet

mgen-javascriptlib/src/main/javascript/mgen-lib.js:195–204  ·  view source on GitHub ↗
(obj, path, value)

Source from the content-addressed store, hash-verified

193 }
194
195 function treeIndexSet(obj, path, value) {
196 if (typeof path === "string") {
197 treeIndexSet(obj, path.split("."), value);
198 } else if (path.length === 1) {
199 obj[path[0]] = value;
200 } else {
201 obj[path[0]] = obj[path[0]] || {};
202 treeIndexSet(obj[path[0]], path.slice(1), value);
203 }
204 }
205
206 function registerClass(obj, path) {
207 var currentClassType, currentClassPath, collidingClassType, collidingClassPath,

Callers 1

registerClassFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected