(path: string)
| 31 | } |
| 32 | |
| 33 | function readJsonc(path: string): Record<string, unknown> | null { |
| 34 | const content = readFileSync(path, "utf-8"); |
| 35 | try { |
| 36 | return parseJsonc(content) as Record<string, unknown>; |
| 37 | } catch (err) { |
| 38 | console.error(` ⚠ Failed to parse ${path}: ${err instanceof Error ? err.message : err}`); |
| 39 | return null; |
| 40 | } |
| 41 | } |
| 42 | // ─── Config Manipulators ────────────────────────────────── |
| 43 | |
| 44 | function addPluginToOpenCodeConfig(configPath: string, format: "json" | "jsonc" | "none"): void { |
no test coverage detected