mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 09:32:42 +00:00
refactor(media): share fileExists
This commit is contained in:
13
src/media-understanding/fs.ts
Normal file
13
src/media-understanding/fs.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user