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