MCPcopy Create free account
hub / github.com/Semporia/Scripts / writedata

Method writedata

jd_goodMorning.js:262–272  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

260 }
261 }
262 writedata() {
263 if (this.isNode()) {
264 this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path");
265 const t = this.path.resolve(this.dataFile),
266 e = this.path.resolve(process.cwd(), this.dataFile),
267 s = this.fs.existsSync(t),
268 i = !s && this.fs.existsSync(e),
269 r = JSON.stringify(this.data);
270 s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r)
271 }
272 }
273 lodash_get(t, e, s) {
274 const i = e.replace(/\[(\d+)\]/g, ".$1").split(".");
275 let r = t;

Callers 1

setvalMethod · 0.45

Calls 1

isNodeMethod · 0.45

Tested by

no test coverage detected