(options: WalkOptions)
| 74 | } |
| 75 | |
| 76 | export async function walkDirectory(options: WalkOptions): Promise<FileEntry[]> { |
| 77 | const rootDir = resolve(options.rootDir); |
| 78 | const startDir = options.targetPath ? resolve(rootDir, options.targetPath) : rootDir; |
| 79 | const ig = await loadIgnoreRules(rootDir); |
| 80 | const results: FileEntry[] = []; |
| 81 | |
| 82 | try { |
| 83 | await stat(startDir); |
| 84 | } catch { |
| 85 | return results; |
| 86 | } |
| 87 | |
| 88 | await walkRecursive(startDir, rootDir, ig, 0, options.depthLimit ?? 0, results); |
| 89 | return results; |
| 90 | } |
| 91 | |
| 92 | export function groupByDirectory(entries: FileEntry[]): Map<string, FileEntry[]> { |
| 93 | const groups = new Map<string, FileEntry[]>(); |
no test coverage detected