MCPcopy Create free account
hub / github.com/Semporia/Scripts / setdata

Method setdata

jd_superMarket.js:2255–2268  ·  view source on GitHub ↗
(t, e)

Source from the content-addressed store, hash-verified

2253 }
2254
2255 setdata(t, e) {
2256 let s = !1;
2257 if (/^@/.test(e)) {
2258 const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}";
2259 try {
2260 const e = JSON.parse(h);
2261 this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i)
2262 } catch (e) {
2263 const o = {};
2264 this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i)
2265 }
2266 } else s = this.setval(t, e);
2267 return s
2268 }
2269
2270 getval(t) {
2271 return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null

Callers 1

setjsonMethod · 0.45

Calls 3

getvalMethod · 0.45
lodash_setMethod · 0.45
setvalMethod · 0.45

Tested by

no test coverage detected