(handle: any, prefix = "")
| 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); |
no test coverage detected