| 126 | } |
| 127 | |
| 128 | loaddata() { |
| 129 | if (!this.isNode()) return {}; |
| 130 | { |
| 131 | this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); |
| 132 | const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); |
| 133 | if (!s && !i) return {}; |
| 134 | { |
| 135 | const i = s ? t : e; |
| 136 | try { |
| 137 | return JSON.parse(this.fs.readFileSync(i)) |
| 138 | } catch (t) { |
| 139 | return {} |
| 140 | } |
| 141 | } |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | writedata() { |
| 146 | if (this.isNode()) { |