(configPath: string)
| 77 | } |
| 78 | |
| 79 | async function readTelemetryConfigFile(configPath: string) { |
| 80 | if (!existsSync(configPath)) { |
| 81 | return undefined |
| 82 | } |
| 83 | |
| 84 | try { |
| 85 | const raw = await readFile(configPath, 'utf8') |
| 86 | const parsed = JSON.parse(raw) |
| 87 | if (!isTelemetryConfig(parsed)) { |
| 88 | return undefined |
| 89 | } |
| 90 | |
| 91 | return parsed |
| 92 | } catch { |
| 93 | return undefined |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | async function writeTelemetryConfigFile( |
| 98 | configPath: string, |
no test coverage detected