()
| 183 | } |
| 184 | } catch (error: any) { |
| 185 | console.error("Failed to read config:", error); |
| 186 | } |
| 187 | return {}; |
| 188 | } |
| 189 | |
| 190 | function 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 | } |
no test coverage detected