MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / set

Method set

daily/ydyp.js:221–223  ·  view source on GitHub ↗
(e, t, o)

Source from the content-addressed store, hash-verified

219 return Object.fromEntries(r)
220 }
221 static set(e, t, o) {
222 return Array.isArray(t) || (t = r.toPath(t)), t.slice(0, -1).reduce((e, r, o) => Object(e[r]) === e[r] ? e[r] : e[r] = /^\d+$/.test(t[o + 1]) ? [] : {}, e)[t[t.length - 1]] = o, e
223 }
224 static toPath(e) {
225 return e.replace(/\[(\d+)\]/g, ".$1").split(".").filter(Boolean)
226 }

Callers 6

loginMethod · 0.45
ObjectKeys2LowerCaseMethod · 0.45
tClass · 0.45
mergeMethod · 0.45
ydyp.jsFile · 0.45
setItemMethod · 0.45

Calls 1

toPathMethod · 0.80

Tested by

no test coverage detected