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

Method setdata

jd_joy_new.js:1122–1135  ·  view source on GitHub ↗
(t, e)

Source from the content-addressed store, hash-verified

1120 }
1121
1122 setdata(t, e) {
1123 let s = !1;
1124 if (/^@/.test(e)) {
1125 const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}";
1126 try {
1127 const e = JSON.parse(h);
1128 this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i)
1129 } catch (e) {
1130 const o = {};
1131 this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i)
1132 }
1133 } else s = this.setval(t, e);
1134 return s
1135 }
1136
1137 getval(t) {
1138 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