()
| 336 | } |
| 337 | |
| 338 | private readConfig(): ConfigFile | null { |
| 339 | if (this.configCache !== undefined) return this.configCache; |
| 340 | try { |
| 341 | const raw = JSON.parse(fs.readFileSync(this.configPath, 'utf8')) as ConfigFile; |
| 342 | this.configCache = typeof raw.machine_id === 'string' && typeof raw.enabled === 'boolean' ? raw : null; |
| 343 | } catch { |
| 344 | this.configCache = null; |
| 345 | } |
| 346 | return this.configCache; |
| 347 | } |
| 348 | |
| 349 | private writeConfig(config: ConfigFile): void { |
| 350 | try { |
no outgoing calls
no test coverage detected