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

Method writedata

wxapp/miaoyouHome.js:200–211  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

198 }
199 }
200 writedata() {
201 if (this.isNode()) {
202 this.fs = this.fs ? this.fs : require("fs");
203 this.path = this.path ? this.path : require("path");
204 const t = this.path.resolve(this.dataFile),
205 s = this.path.resolve(process.cwd(), this.dataFile),
206 e = this.fs.existsSync(t),
207 i = !e && this.fs.existsSync(s),
208 o = JSON.stringify(this.data);
209 e ? this.writeFileSync(t, o) : i ? this.fs.writeFileSync(s, o) : this.fs.writeFileSync(t, o);
210 }
211 }
212 lodash_get(t, s, e) {
213 const i = s.replace(/\[(\d+)\]/g, ".$1").split(".");
214 let o = t;

Callers 1

setvalMethod · 0.45

Calls 1

isNodeMethod · 0.45

Tested by

no test coverage detected