MCPcopy Create free account
hub / github.com/bewcloud/bewcloud / getPathInfo

Function getPathInfo

lib/models/files.ts:767–778  ·  view source on GitHub ↗
(userId: string, path: string)

Source from the content-addressed store, hash-verified

765}
766
767export 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
780async function getDirectorySizeFallback(path: string): Promise<number> {
781 let totalSize = 0;

Callers 1

postFunction · 0.90

Tested by

no test coverage detected