(startPath: string, boundaryPath: string)
| 41 | } |
| 42 | |
| 43 | function listParentDirectories(startPath: string, boundaryPath: string): string[] { |
| 44 | const parents: string[] = []; |
| 45 | const start = resolve(startPath); |
| 46 | const boundary = resolve(boundaryPath); |
| 47 | |
| 48 | if (!isPathWithinBoundary(start, boundary)) { |
| 49 | return parents; |
| 50 | } |
| 51 | |
| 52 | let current = start; |
| 53 | while (true) { |
| 54 | const parent = dirname(current); |
| 55 | if (parent === current) { |
| 56 | break; |
| 57 | } |
| 58 | |
| 59 | if (!isPathWithinBoundary(parent, boundary)) { |
| 60 | break; |
| 61 | } |
| 62 | |
| 63 | parents.push(parent); |
| 64 | if (parent === boundary) { |
| 65 | break; |
| 66 | } |
| 67 | |
| 68 | current = parent; |
| 69 | } |
| 70 | |
| 71 | return parents; |
| 72 | } |
| 73 | |
| 74 | function collectFindPaths(output: string): string[] { |
| 75 | return output |
no test coverage detected