(path?: string)
| 31 | : ''; |
| 32 | |
| 33 | export const normalizePath = (path?: string): string => |
| 34 | path |
| 35 | ? path.startsWith('/') |
| 36 | ? ('/' + path.replace(/\/+$/, '')).replace(/\/+/g, '/') |
| 37 | : '/' + path.replace(/\/+$/, '') |
| 38 | : '/'; |
| 39 | |
| 40 | export const stripEndSlash = (path: string) => |
| 41 | path[path.length - 1] === '/' ? path.slice(0, path.length - 1) : path; |
no test coverage detected