(dir)
| 25 | const files = []; |
| 26 | |
| 27 | async function walk(dir) { |
| 28 | const entries = await readdir(dir, { withFileTypes: true }); |
| 29 | for (const entry of entries) { |
| 30 | const path = join(dir, entry.name); |
| 31 | if (entry.isDirectory()) { |
| 32 | await walk(path); |
| 33 | continue; |
| 34 | } |
| 35 | if (entry.isFile()) { |
| 36 | files.push(path); |
| 37 | } |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | await walk(root); |
| 42 | return files; |