( filePath: string, transforms: StringTransform[] | null | undefined )
| 113 | * Transforms file's content in-place. |
| 114 | */ |
| 115 | export async function transformFileAsync( |
| 116 | filePath: string, |
| 117 | transforms: StringTransform[] | null | undefined |
| 118 | ): Promise<void> { |
| 119 | const content = await fs.readFile(filePath, 'utf8'); |
| 120 | await fs.outputFile(filePath, transformString(content, transforms)); |
| 121 | } |
| 122 | |
| 123 | /** |
| 124 | * Transforms multiple files' content in-place. |
no test coverage detected
searching dependent graphs…