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

Method setdata

jd_redPacket.js:1715–1728  ·  view source on GitHub ↗
(t, e)

Source from the content-addressed store, hash-verified

1713 }
1714
1715 setdata(t, e) {
1716 let s = !1;
1717 if (/^@/.test(e)) {
1718 const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}";
1719 try {
1720 const e = JSON.parse(h);
1721 this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i)
1722 } catch (e) {
1723 const o = {};
1724 this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i)
1725 }
1726 } else s = this.setval(t, e);
1727 return s
1728 }
1729
1730 getval(t) {
1731 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