()
| 2329 | }).catch((t) => this.logErr(t)); |
| 2330 | } |
| 2331 | loaddata() { |
| 2332 | if (!this.isNode()) |
| 2333 | return {}; { |
| 2334 | (this.fs = this.fs ? this.fs : require('fs')), |
| 2335 | (this.path = this.path ? this.path : require('path')); |
| 2336 | const t = this.path.resolve(this.dataFile), |
| 2337 | s = this.path.resolve(process.cwd(), this.dataFile), |
| 2338 | e = this.fs.existsSync(t), |
| 2339 | i = !e && this.fs.existsSync(s); |
| 2340 | if (!e && !i) |
| 2341 | return {}; { |
| 2342 | const i = e ? t : s; |
| 2343 | try { |
| 2344 | return JSON.parse(this.fs.readFileSync(i)); |
| 2345 | } catch (t) { |
| 2346 | return {}; |
| 2347 | } |
| 2348 | } |
| 2349 | } |
| 2350 | } |
| 2351 | writedata() { |
| 2352 | if (this.isNode()) { |
| 2353 | (this.fs = this.fs ? this.fs : require('fs')), |
no test coverage detected