(path: string)
| 33 | |
| 34 | /** Trim trailing slashes (except preserving root '/'). */ |
| 35 | export function trimPathRight(path: string) { |
| 36 | const len = path.length |
| 37 | return len > 1 && path[len - 1] === '/' ? path.replace(/\/{1,}$/, '') : path |
| 38 | } |
| 39 | |
| 40 | /** Trim both leading and trailing slashes. */ |
| 41 | export function trimPath(path: string) { |
no test coverage detected