MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / _next

Function _next

framework/utils/lib/utils.ts:46–59  ·  view source on GitHub ↗
(p: string)

Source from the content-addressed store, hash-verified

44export function folderSize(folderPath: string) {
45 let size = 0;
46 const _next = function a(p: string) {
47 if (p) {
48 const stats = fs.statSync(p);
49 if (!stats.isDirectory() || stats.isSymbolicLink()) {
50 if (!stats.isSymbolicLink()) size += stats.size;
51 } else {
52 size += stats.size;
53 const files = fs.readdirSync(p);
54 if (Array.isArray(files)) {
55 for (const file of files) _next(path.join(p, file));
56 }
57 }
58 }
59 };
60 _next(folderPath);
61 return size;
62}

Callers 1

folderSizeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected