MCPcopy
hub / github.com/flatiron/prompt / putNested

Function putNested

lib/prompt.js:725–738  ·  view source on GitHub ↗
(obj, path, value)

Source from the content-addressed store, hash-verified

723 }
724
725 function putNested (obj, path, value) {
726 var last = obj, key;
727
728 while (path.length > 1) {
729 key = path.shift();
730 if (!last[key]) {
731 last[key] = {};
732 }
733
734 last = last[key];
735 }
736
737 last[path.shift()] = value;
738 }
739
740 Object.keys(results).forEach(function (key) {
741 putNested(obj, key.split('.'), results[key]);

Callers 1

prompt.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…