MCPcopy Index your code
hub / github.com/smallfawn/QLScriptPublic / loaddata

Method loaddata

jlld.js:245–264  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

243 return "undefined" != typeof $loon;
244 }
245 loaddata() {
246 if (!this.isNode()) return {};
247 {
248 this.fs = this.fs ? this.fs : require("fs");
249 this.path = this.path ? this.path : require("path");
250 const t = this.path.resolve(this.dataFile),
251 s = this.path.resolve(process.cwd(), this.dataFile),
252 e = this.fs.existsSync(t),
253 i = !e && this.fs.existsSync(s);
254 if (!e && !i) return {};
255 {
256 const i = e ? t : s;
257 try {
258 return JSON.parse(this.fs.readFileSync(i));
259 } catch (t) {
260 return {};
261 }
262 }
263 }
264 }
265 writedata() {
266 if (this.isNode()) {
267 this.fs = this.fs ? this.fs : require("fs");

Callers 2

getvalMethod · 0.45
setvalMethod · 0.45

Calls 1

isNodeMethod · 0.45

Tested by

no test coverage detected