mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-07 07:11:06 +00:00
14 lines
246 B
TypeScript
14 lines
246 B
TypeScript
import fs from "node:fs/promises";
|
|
|
|
export async function fileExists(filePath?: string | null): Promise<boolean> {
|
|
if (!filePath) {
|
|
return false;
|
|
}
|
|
try {
|
|
await fs.stat(filePath);
|
|
return true;
|
|
} catch {
|
|
return false;
|
|
}
|
|
}
|