(fn: (() => void) | (() => Promise<void>))
| 12 | const cleanupFunctions: Array<(() => void) | (() => Promise<void>)> = []; |
| 13 | |
| 14 | export function registerCleanup(fn: (() => void) | (() => Promise<void>)) { |
| 15 | cleanupFunctions.push(fn); |
| 16 | } |
| 17 | |
| 18 | export async function runExitCleanup() { |
| 19 | for (const fn of cleanupFunctions) { |