(path: Path)
| 81 | * Return the basename of the path, as a Path. See path.basename |
| 82 | */ |
| 83 | export function basename(path: Path): PathFragment { |
| 84 | const i = path.lastIndexOf(NormalizedSep); |
| 85 | if (i == -1) { |
| 86 | return fragment(path); |
| 87 | } else { |
| 88 | return fragment(path.slice(path.lastIndexOf(NormalizedSep) + 1)); |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | /** |
| 93 | * Return the dirname of the path, as a Path. See path.dirname |
no test coverage detected