()
| 2878 | }).catch((t) => this.logErr(t)); |
| 2879 | } |
| 2880 | loaddata() { |
| 2881 | if (!this.isNode()) |
| 2882 | return {}; { |
| 2883 | (this.fs = this.fs ? this.fs : require('fs')), |
| 2884 | (this.path = this.path ? this.path : require('path')); |
| 2885 | const t = this.path.resolve(this.dataFile), |
| 2886 | s = this.path.resolve(process.cwd(), this.dataFile), |
| 2887 | e = this.fs.existsSync(t), |
| 2888 | i = !e && this.fs.existsSync(s); |
| 2889 | if (!e && !i) |
| 2890 | return {}; { |
| 2891 | const i = e ? t : s; |
| 2892 | try { |
| 2893 | return JSON.parse(this.fs.readFileSync(i)); |
| 2894 | } catch (t) { |
| 2895 | return {}; |
| 2896 | } |
| 2897 | } |
| 2898 | } |
| 2899 | } |
| 2900 | writedata() { |
| 2901 | if (this.isNode()) { |
| 2902 | (this.fs = this.fs ? this.fs : require('fs')), |
no test coverage detected