( filePath: string, content: string, flag: 'w' | 'wx' = 'w', )
| 323 | } |
| 324 | |
| 325 | async function writeFileAndFlush( |
| 326 | filePath: string, |
| 327 | content: string, |
| 328 | flag: 'w' | 'wx' = 'w', |
| 329 | ): Promise<void> { |
| 330 | const handle = await open(filePath, flag) |
| 331 | try { |
| 332 | await handle.writeFile(content, { encoding: 'utf-8' }) |
| 333 | await handle.datasync() |
| 334 | } finally { |
| 335 | await handle.close() |
| 336 | } |
| 337 | } |
no test coverage detected