MCPcopy Create free account
hub / github.com/Script-Hub-Org/Script-Hub / setdata

Method setdata

env/env.js:187–202  ·  view source on GitHub ↗
(t, e)

Source from the content-addressed store, hash-verified

185 return e
186 }
187 setdata(t, e) {
188 let s = !1
189 if (/^@/.test(e)) {
190 const [, a, r] = /^@(.*?)\.(.*?)$/.exec(e),
191 i = this.getval(a),
192 o = a ? ('null' === i ? null : i || '{}') : '{}'
193 try {
194 const e = JSON.parse(o)
195 this.lodash_set(e, r, t), (s = this.setval(JSON.stringify(e), a))
196 } catch (e) {
197 const i = {}
198 this.lodash_set(i, r, t), (s = this.setval(JSON.stringify(i), a))
199 }
200 } else s = this.setval(t, e)
201 return s
202 }
203 getval(t) {
204 switch (this.getEnv()) {
205 case 'Surge':

Callers 1

setjsonMethod · 0.45

Calls 4

getvalMethod · 0.45
parseMethod · 0.45
lodash_setMethod · 0.45
setvalMethod · 0.45

Tested by

no test coverage detected