mirror of
https://github.com/luckyyzh/pi-agent-integrated.git
synced 2026-10-03 02:59:35 +00:00
feat: integrate Pi backend and Pi Web
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import fs from "fs";
|
||||
|
||||
type DirentType = Pick<fs.Dirent, "isDirectory" | "isFile">;
|
||||
|
||||
export function resolveDirentIsDirectory(
|
||||
dirent: DirentType,
|
||||
fullPath: string,
|
||||
): boolean | null {
|
||||
if (dirent.isDirectory()) return true;
|
||||
if (dirent.isFile()) return false;
|
||||
|
||||
try {
|
||||
return fs.statSync(fullPath).isDirectory();
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user