(dir: string)
| 10 | * @returns |
| 11 | */ |
| 12 | export const walkFiles = async (dir: string): Promise<string[]> => { |
| 13 | const dirEntries = await readdir(dir, { withFileTypes: true }); |
| 14 | |
| 15 | return flatten( |
| 16 | await Promise.all( |
| 17 | dirEntries.map(async (dirent) => { |
| 18 | const filePath = path.join(dir, dirent.name); |
| 19 | return dirent.isDirectory() ? await walkFiles(filePath) : [filePath]; |
| 20 | }) |
| 21 | ) |
| 22 | ); |
| 23 | }; |
no outgoing calls
no test coverage detected