MCPcopy Create free account
hub / github.com/6dylan6/jdpro / writedata

Method writedata

function/sendNotify.js:2351–2362  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2349 }
2350 }
2351 writedata() {
2352 if (this.isNode()) {
2353 (this.fs = this.fs ? this.fs : require('fs')),
2354 (this.path = this.path ? this.path : require('path'));
2355 const t = this.path.resolve(this.dataFile),
2356 s = this.path.resolve(process.cwd(), this.dataFile),
2357 e = this.fs.existsSync(t),
2358 i = !e && this.fs.existsSync(s),
2359 o = JSON.stringify(this.data);
2360 e ? this.fs.writeFileSync(t, o) : i ? this.fs.writeFileSync(s, o) : this.fs.writeFileSync(t, o);
2361 }
2362 }
2363 lodash_get(t, s, e) {
2364 const i = s.replace(/\[(\d+)\]/g, '.$1').split('.');
2365 let o = t;

Callers 1

setvalMethod · 0.45

Calls 2

writeFileSyncMethod · 0.80
isNodeMethod · 0.45

Tested by

no test coverage detected