| 727 | } |
| 728 | |
| 729 | loaddata() { |
| 730 | if (!this.isNode()) return {}; |
| 731 | { |
| 732 | this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); |
| 733 | 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); |
| 734 | if (!s && !i) return {}; |
| 735 | { |
| 736 | const i = s ? t : e; |
| 737 | try { |
| 738 | return JSON.parse(this.fs.readFileSync(i)) |
| 739 | } catch (t) { |
| 740 | return {} |
| 741 | } |
| 742 | } |
| 743 | } |
| 744 | } |
| 745 | |
| 746 | writedata() { |
| 747 | if (this.isNode()) { |