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

Method loaddata

sendNotify.js:921–937  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

919 }
920
921 loaddata() {
922 if (!this.isNode()) return {};
923 {
924 this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path");
925 const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile),
926 s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e);
927 if (!s && !i) return {};
928 {
929 const i = s ? t : e;
930 try {
931 return JSON.parse(this.fs.readFileSync(i))
932 } catch (t) {
933 return {}
934 }
935 }
936 }
937 }
938
939 writedata() {
940 if (this.isNode()) {

Callers 2

getvalMethod · 0.45
setvalMethod · 0.45

Calls 1

isNodeMethod · 0.45

Tested by

no test coverage detected