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

Method setdata

jd_api_test.js:262–275  ·  view source on GitHub ↗
(t, e)

Source from the content-addressed store, hash-verified

260 }
261
262 setdata(t, e) {
263 let s = !1;
264 if (/^@/.test(e)) {
265 const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}";
266 try {
267 const e = JSON.parse(h);
268 this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i)
269 } catch (e) {
270 const o = {};
271 this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i)
272 }
273 } else s = this.setval(t, e);
274 return s
275 }
276
277 getval(t) {
278 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