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

Method get

tools/env.js:27–37  ·  view source on GitHub ↗
(key, def = null)

Source from the content-addressed store, hash-verified

25 }
26 }
27 async get(key, def = null) {
28 if (!this.isNode()) return def;
29 try {
30 const data = await this.fs.promises.readFile(this.bucket, "utf-8");
31 const json = JSON.parse(data);
32 return json.hasOwnProperty(key) ? json[key] : def;
33 } catch (e) {
34 this.log("❌ 读取bucket失败: " + e.message);
35 return def;
36 }
37 }
38 async set(key, value) {
39 if (!this.isNode()) return;
40 try {

Callers 1

sendNotify.jsFile · 0.45

Calls 3

readFileMethod · 0.80
isNodeMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected