MCPcopy Create free account
hub / github.com/CodeGraphContext/CodeGraphContext / readDir

Function readDir

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

Source from the content-addressed store, hash-verified

252
253 const files: any[] = [];
254 async function readDir(handle: any, prefix = "") {
255 for await (const entry of handle.values()) {
256 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)$/)) {
257 const file = await entry.getFile();
258 files.push({ path: `${prefix}/${entry.name}`, content: await file.text() });
259 } else if (entry.kind === 'directory' && !isDirIgnored(entry.name)) {
260 await readDir(entry, `${prefix}/${entry.name}`);
261 }
262 }
263 }
264
265 await readDir(dirHandle);
266 await processFiles(files, dirHandle.name);

Callers 1

handleFolderSelectFunction · 0.85

Calls 4

isDirIgnoredFunction · 0.85
valuesMethod · 0.45
pushMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected