(filePath: string)
| 13 | |
| 14 | /** Remove a file, ignoring ENOENT (already gone). Rethrows other errors. */ |
| 15 | export function safeUnlink(filePath: string): void { |
| 16 | try { |
| 17 | fs.unlinkSync(filePath); |
| 18 | } catch (err: any) { |
| 19 | if (err?.code !== 'ENOENT') throw err; |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | /** Remove a file, ignoring ALL errors. Use only in best-effort cleanup (shutdown, emergency). */ |
| 24 | export function safeUnlinkQuiet(filePath: string): void { |
no outgoing calls
no test coverage detected