MCPcopy Create free account
hub / github.com/Toulu-debug/enen / setdata

Method setdata

utils/jd_appopen.js:183–196  ·  view source on GitHub ↗
(t, e)

Source from the content-addressed store, hash-verified

181 }
182
183 setdata(t, e) {
184 let s = !1;
185 if (/^@/.test(e)) {
186 const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}";
187 try {
188 const e = JSON.parse(h);
189 this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i)
190 } catch (e) {
191 const o = {};
192 this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i)
193 }
194 } else s = this.setval(t, e);
195 return s
196 }
197
198 getval(t) {
199 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