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

Function treeIndexGet

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

Source from the content-addressed store, hash-verified

175 }
176
177 function treeIndexGet(obj, path) {
178 var original_path = path;
179
180 function recTreeIndexGet(obj, path) {
181 if (typeof path === "string") {
182 return recTreeIndexGet(obj, path.split("."));
183 } else if (path.length === 0 || obj[path[0]] === undefined) {
184 if (typeof obj !== "function") {
185 throw Error("Class " + original_path + " not found in ClassRegistryBlueprint.");
186 }
187 return obj;
188 } else {
189 return recTreeIndexGet(obj[path[0]], path.slice(1));
190 }
191 }
192 return recTreeIndexGet(obj, path);
193 }
194
195 function treeIndexSet(obj, path, value) {
196 if (typeof path === "string") {

Callers 1

mgen-lib.jsFile · 0.85

Calls 1

recTreeIndexGetFunction · 0.85

Tested by

no test coverage detected