MCPcopy Create free account
hub / github.com/Semporia/Scripts / loaddata

Method loaddata

jd_pk.js:853–871  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

851 }
852
853 loaddata() {
854 if (!this.isNode()) return {};
855 {
856 this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path");
857 const t = this.path.resolve(this.dataFile),
858 e = this.path.resolve(process.cwd(), this.dataFile),
859 s = this.fs.existsSync(t),
860 i = !s && this.fs.existsSync(e);
861 if (!s && !i) return {};
862 {
863 const i = s ? t : e;
864 try {
865 return JSON.parse(this.fs.readFileSync(i))
866 } catch (t) {
867 return {}
868 }
869 }
870 }
871 }
872
873 writedata() {
874 if (this.isNode()) {

Callers 2

getvalMethod · 0.45
setvalMethod · 0.45

Calls 1

isNodeMethod · 0.45

Tested by

no test coverage detected