| 210 | } |
| 211 | |
| 212 | loaddata() { |
| 213 | if (!this.isNode()) return {}; |
| 214 | { |
| 215 | this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); |
| 216 | 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); |
| 217 | if (!s && !i) return {}; |
| 218 | { |
| 219 | const i = s ? t : e; |
| 220 | try { |
| 221 | return JSON.parse(this.fs.readFileSync(i)) |
| 222 | } catch (t) { |
| 223 | return {} |
| 224 | } |
| 225 | } |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | writedata() { |
| 230 | if (this.isNode()) { |