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

Method setdata

sendNotify.js:2938–2956  ·  view source on GitHub ↗
(t, s)

Source from the content-addressed store, hash-verified

2936 return s;
2937 }
2938 setdata(t, s) {
2939 let e = !1;
2940 if (/^@/.test(s)) {
2941 const[, i, o] = /^@(.*?)\.(.*?)$/.exec(s),
2942 h = this.getval(i),
2943 a = i ? ('null' === h ? null : h || '{}') : '{}';
2944 try {
2945 const s = JSON.parse(a);
2946 this.lodash_set(s, o, t),
2947 (e = this.setval(JSON.stringify(s), i));
2948 } catch (s) {
2949 const h = {};
2950 this.lodash_set(h, o, t),
2951 (e = this.setval(JSON.stringify(h), i));
2952 }
2953 } else
2954 e = $.setval(t, s);
2955 return e;
2956 }
2957 getval(t) {
2958 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;
2959 }

Callers

nothing calls this directly

Calls 3

getvalMethod · 0.45
lodash_setMethod · 0.45
setvalMethod · 0.45

Tested by

no test coverage detected