`folder` and each folder above it, the project root ('') last.
(folder: string)
| 38 | |
| 39 | /** `folder` and each folder above it, the project root ('') last. */ |
| 40 | function foldersAbove(folder: string): string[] { |
| 41 | const out: string[] = []; |
| 42 | let dir = folder; |
| 43 | for (;;) { |
| 44 | out.push(dir); |
| 45 | if (dir === '') return out; |
| 46 | const up = path.posix.dirname(dir); |
| 47 | dir = up === '.' ? '' : up; |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | /** |
| 52 | * `written` (the path an include appends to the web root, `inc/header.php`) |
no test coverage detected