(userId: string, path: string)
| 765 | } |
| 766 | |
| 767 | export async function getPathInfo(userId: string, path: string): Promise<{ isDirectory: boolean; isFile: boolean }> { |
| 768 | await ensureUserPathIsValidAndSecurelyAccessible(userId, path); |
| 769 | |
| 770 | const rootPath = join(await AppConfig.getFilesRootPath(), userId); |
| 771 | |
| 772 | const stat = await Deno.stat(join(rootPath, path)); |
| 773 | |
| 774 | return { |
| 775 | isDirectory: stat.isDirectory, |
| 776 | isFile: stat.isFile, |
| 777 | }; |
| 778 | } |
| 779 | |
| 780 | async function getDirectorySizeFallback(path: string): Promise<number> { |
| 781 | let totalSize = 0; |
no test coverage detected