(path: string)
| 47 | } |
| 48 | |
| 49 | export function dirnamePath(path: string): string { |
| 50 | const normalized = normalizePath(path) |
| 51 | if (normalized === '/') { |
| 52 | return '/' |
| 53 | } |
| 54 | |
| 55 | const parts = normalized.split('/') |
| 56 | parts.pop() |
| 57 | |
| 58 | if (!parts.length) { |
| 59 | return '.' |
| 60 | } |
| 61 | |
| 62 | if (parts.length === 1 && parts[0] === '') { |
| 63 | return '/' |
| 64 | } |
| 65 | |
| 66 | return parts.join('/') || '.' |
| 67 | } |
| 68 | |
| 69 | export function extnamePath(path: string): string { |
| 70 | const basename = basenamePath(path) |
nothing calls this directly
no test coverage detected