MCPcopy
hub / github.com/allmarkedup/purl / merge

Function merge

purl.js:111–126  ·  view source on GitHub ↗
(parent, key, val)

Source from the content-addressed store, hash-verified

109 }
110
111 function merge(parent, key, val) {
112 if (~key.indexOf(']')) {
113 var parts = key.split('[');
114 parse(parts, parent, 'base', val);
115 } else {
116 if (!isint.test(key) && isArray(parent.base)) {
117 var t = {};
118 for (var k in parent.base) t[k] = parent.base[k];
119 parent.base = t;
120 }
121 if (key !== '') {
122 set(parent.base, key, val);
123 }
124 }
125 return parent;
126 }
127
128 function parseString(str) {
129 return reduce(String(str).split(/&|;/), function(ret, pair) {

Callers 1

parseStringFunction · 0.85

Calls 3

parseFunction · 0.85
isArrayFunction · 0.85
setFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…