MCPcopy Create free account
hub / github.com/Toulu-debug/enen / loaddata

Method loaddata

jd_speed_coin.js:766–782  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

764 }
765
766 loaddata() {
767 if (!this.isNode()) return {};
768 {
769 this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path");
770 const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile),
771 s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e);
772 if (!s && !i) return {};
773 {
774 const i = s ? t : e;
775 try {
776 return JSON.parse(this.fs.readFileSync(i))
777 } catch (t) {
778 return {}
779 }
780 }
781 }
782 }
783
784 writedata() {
785 if (this.isNode()) {

Callers 2

getvalMethod · 0.45
setvalMethod · 0.45

Calls 1

isNodeMethod · 0.45

Tested by

no test coverage detected