MCPcopy Create free account
hub / github.com/6dylan6/jdm / setdata

Method setdata

function/sendNotify.js:2389–2407  ·  view source on GitHub ↗
(t, s)

Source from the content-addressed store, hash-verified

2387 return s;
2388 }
2389 setdata(t, s) {
2390 let e = !1;
2391 if (/^@/.test(s)) {
2392 const[, i, o] = /^@(.*?)\.(.*?)$/.exec(s),
2393 h = this.getval(i),
2394 a = i ? ('null' === h ? null : h || '{}') : '{}';
2395 try {
2396 const s = JSON.parse(a);
2397 this.lodash_set(s, o, t),
2398 (e = this.setval(JSON.stringify(s), i));
2399 } catch (s) {
2400 const h = {};
2401 this.lodash_set(h, o, t),
2402 (e = this.setval(JSON.stringify(h), i));
2403 }
2404 } else
2405 e = $.setval(t, s);
2406 return e;
2407 }
2408 getval(t) {
2409 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;
2410 }

Callers

nothing calls this directly

Calls 3

getvalMethod · 0.45
lodash_setMethod · 0.45
setvalMethod · 0.45

Tested by

no test coverage detected