(dirArg: string | undefined, cwd: string | undefined)
| 2301 | // --------------------------------------------------------------- |
| 2302 | |
| 2303 | function resolveDir(dirArg: string | undefined, cwd: string | undefined): string { |
| 2304 | if (dirArg !== undefined && dirArg !== "") { |
| 2305 | return dirArg.startsWith("/") ? dirArg : joinPath(cwd ?? "/", dirArg); |
| 2306 | } |
| 2307 | return cwd ?? "/"; |
| 2308 | } |
| 2309 | |
| 2310 | function joinPath(base: string, segment: string): string { |
| 2311 | if (base.endsWith("/")) return `${base}${segment}`; |
no test coverage detected