MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / setdata

Method setdata

wxapp/miaoyouHome.js:248–263  ·  view source on GitHub ↗
(t, s)

Source from the content-addressed store, hash-verified

246 return s;
247 }
248 setdata(t, s) {
249 let e = !1;
250 if (/^@/.test(s)) {
251 const [, i, o] = /^@(.*?)\.(.*?)$/.exec(s),
252 h = this.getval(i),
253 a = i ? ("null" === h ? null : h || "{}") : "{}";
254 try {
255 const s = JSON.parse(a);
256 this.lodash_set(s, o, t), (e = this.setval(JSON.stringify(s), i));
257 } catch (s) {
258 const h = {};
259 this.lodash_set(h, o, t), (e = this.setval(JSON.stringify(h), i));
260 }
261 } else e = this.setval(t, s);
262 return e;
263 }
264 getval(t) {
265 if (this.isSurge() || this.isLoon()) {
266 return $persistentStore.read(t);

Callers

nothing calls this directly

Calls 3

getvalMethod · 0.45
lodash_setMethod · 0.45
setvalMethod · 0.45

Tested by

no test coverage detected