( filePath: string, content: string, flag: 'w' | 'wx' = 'w', )
| 258 | } |
| 259 | |
| 260 | async function writeFileAndFlush( |
| 261 | filePath: string, |
| 262 | content: string, |
| 263 | flag: 'w' | 'wx' = 'w', |
| 264 | ): Promise<void> { |
| 265 | const handle = await open(filePath, flag) |
| 266 | try { |
| 267 | await handle.writeFile(content, { encoding: 'utf-8' }) |
| 268 | await handle.datasync() |
| 269 | } finally { |
| 270 | await handle.close() |
| 271 | } |
| 272 | } |
| 273 |
no test coverage detected