MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / load

Method load

checkin/checkin.ts:59–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

57class ConfigManager {
58 private readonly configPath: string;
59 private data: CheckInConfig;
60
61 constructor() {
62 const dir = createDirectoryInAssets("checkin");
63 this.configPath = path.join(dir, "checkin_config.json");
64 this.data = this.load();
65 }
66
67 private load(): CheckInConfig {
68 try {
69 if (!fs.existsSync(this.configPath)) return { ...DEFAULT_CONFIG };
70 const raw = JSON.parse(fs.readFileSync(this.configPath, "utf-8"));
71 const merged = { ...DEFAULT_CONFIG, ...raw };
72 merged.targets = Array.isArray(raw?.targets) ? raw.targets : [];
73 return merged;

Callers 10

constructorMethod · 0.95
searchByCodeFunction · 0.80
fetchDetailFunction · 0.80
getNodeInfoFunction · 0.80
getWebsiteInfoFunction · 0.80
readSecretFromConfigFunction · 0.80
extractDNSDataFunction · 0.80
fetchFromBincheckFunction · 0.80
extractLinksMethod · 0.80
extractGalleryImagesMethod · 0.80

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected