(patch: Partial<SpeedtestConfig>)
| 195 | fs.writeFileSync(SPEEDTEST_JSON, JSON.stringify(next)); |
| 196 | } catch (error: any) { |
| 197 | console.error("Failed to write config:", error); |
| 198 | } |
| 199 | } |
| 200 | |
| 201 | function getDefaultServer(): number | null { |
| 202 | const cfg = readConfig(); |
| 203 | return cfg.default_server_id ?? null; |
| 204 | } |
| 205 | |
| 206 | function saveDefaultServer(serverId: number | null): void { |
| 207 | writeConfig({ default_server_id: serverId }); |
| 208 | } |
| 209 |
no test coverage detected