(path: string)
| 72 | } |
| 73 | |
| 74 | function readJsonc(path: string): Record<string, unknown> | null { |
| 75 | try { |
| 76 | return parseJsonc(readFileSync(path, "utf-8")) as Record<string, unknown>; |
| 77 | } catch (error) { |
| 78 | const message = error instanceof Error ? error.message : String(error); |
| 79 | console.warn(`Could not parse ${path}: ${message}`); |
| 80 | return null; |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | function compactObject<T extends Record<string, unknown>>(obj: T): T { |
| 85 | for (const key of Object.keys(obj)) { |
no test coverage detected