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

Function readConfig

speedtest/speedtest.ts:185–195  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

183 }
184 } catch (error: any) {
185 console.error("Failed to read config:", error);
186 }
187 return {};
188}
189
190function writeConfig(patch: Partial<SpeedtestConfig>): void {
191 try {
192 ensureDirectories();
193 const current = readConfig();
194 const next = { ...current, ...patch };
195 fs.writeFileSync(SPEEDTEST_JSON, JSON.stringify(next));
196 } catch (error: any) {
197 console.error("Failed to write config:", error);
198 }

Callers 4

writeConfigFunction · 0.85
getDefaultServerFunction · 0.85
removeDefaultServerFunction · 0.85
getPreferredTypeFunction · 0.85

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected