(dir: string, base = dir)
| 72 | } |
| 73 | |
| 74 | async function listFilesRec(dir: string, base = dir): Promise<string[]> { |
| 75 | const out: string[] = []; |
| 76 | const entries = await readdir(dir, { withFileTypes: true }); |
| 77 | for (const e of entries) { |
| 78 | const full = join(dir, e.name); |
| 79 | if (e.isDirectory()) out.push(...(await listFilesRec(full, base))); |
| 80 | else if (e.isFile()) out.push(relative(base, full)); |
| 81 | } |
| 82 | return out; |
| 83 | } |
| 84 | |
| 85 | // ─── Main ──────────────────────────────────────────────────────────────────── |
| 86 |
no test coverage detected
searching dependent graphs…