MCPcopy Index your code
hub / github.com/CodeGraphContext/CodeGraphContext / readDir

Function readDir

website/src/components/LocalUploader.tsx:57–66  ·  view source on GitHub ↗
(handle: any, prefix = "")

Source from the content-addressed store, hash-verified

55
56 const files: any[] = [];
57 async function readDir(handle: any, prefix = "") {
58 for await (const entry of handle.values()) {
59 if (entry.kind === 'file' && entry.name.match(/\.(js|ts|jsx|tsx|py|c|h|cpp|hpp|cc|cs|go|rs|rb|php|swift|kt|kts|dart)$/)) {
60 const file = await entry.getFile();
61 files.push({ path: `${prefix}/${entry.name}`, content: await file.text() });
62 } else if (entry.kind === 'directory' && !IGNORED_DIRS.has(entry.name)) {
63 await readDir(entry, `${prefix}/${entry.name}`);
64 }
65 }
66 }
67
68 await readDir(dirHandle);
69 await processFiles(files);

Callers 1

handleFolderSelectFunction · 0.85

Calls 4

valuesMethod · 0.80
pushMethod · 0.80
hasMethod · 0.65
textMethod · 0.45

Tested by

no test coverage detected