( path: string, transform: (contents: string) => string )
| 34 | } |
| 35 | |
| 36 | export const rewriteFile = ( |
| 37 | path: string, |
| 38 | transform: (contents: string) => string |
| 39 | ): string => writeFile(path, transform(readFile(path))) |
| 40 | |
| 41 | export const readJson = (path: string): Record<string, unknown> => |
| 42 | JSON.parse(readFileSync(path, { encoding: "utf8" })) |
no test coverage detected