MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / readdir

Method readdir

services/app-builder/src/git/memfs.ts:45–61  ·  view source on GitHub ↗
(dirPath: string)

Source from the content-addressed store, hash-verified

43 }
44
45 async readdir(dirPath: string): Promise<string[]> {
46 const normalized = dirPath === '/' ? '' : dirPath.startsWith('/') ? dirPath.slice(1) : dirPath;
47 const prefix = normalized ? normalized + '/' : '';
48 const results = new Set<string>();
49
50 for (const filePath of this.files.keys()) {
51 if (filePath.startsWith(prefix)) {
52 const relative = filePath.slice(prefix.length);
53 const firstPart = relative.split('/')[0];
54 if (firstPart) {
55 results.add(firstPart);
56 }
57 }
58 }
59
60 return Array.from(results);
61 }
62
63 async stat(path: string): Promise<{
64 type: 'file' | 'dir';

Callers 4

handleInfoRefsMethod · 0.45
handleInfoRefsMethod · 0.45
handleUploadPackMethod · 0.45

Calls 1

addMethod · 0.80

Tested by

no test coverage detected