Files
openclaw/src/media/temp-files.ts
2026-03-03 01:14:14 +00:00

13 lines
262 B
TypeScript

import fs from "node:fs/promises";
export async function unlinkIfExists(filePath: string | null | undefined): Promise<void> {
if (!filePath) {
return;
}
try {
await fs.unlink(filePath);
} catch {
// Best-effort cleanup for temp files.
}
}