* Traverse between `longerDir` (inclusive) and `shorterDir` (exclusive) and call `cb` for each dir. * @param longerDir Longer dir path, e.g. `/User/foo/bar/baz` * @param shorterDir Shorter dir path, e.g. `/User/foo`
( longerDir: string, shorterDir: string, cb: (dir: string) => void, )
| 380 | * @param shorterDir Shorter dir path, e.g. `/User/foo` |
| 381 | */ |
| 382 | function traverseBetweenDirs( |
| 383 | longerDir: string, |
| 384 | shorterDir: string, |
| 385 | cb: (dir: string) => void, |
| 386 | ) { |
| 387 | while (longerDir !== shorterDir) { |
| 388 | cb(longerDir) |
| 389 | longerDir = path.dirname(longerDir) |
| 390 | } |
| 391 | } |
no outgoing calls
no test coverage detected