(input: string)
| 1 | export const normalizeServerUrl = (input: string): string => { |
| 2 | const url = new URL(input) |
| 3 | url.search = "" |
| 4 | url.hash = "" |
| 5 | |
| 6 | const pathname = url.pathname.replace(/\/+$/, "") |
| 7 | return pathname.length === 0 ? url.origin : `${url.origin}${pathname}` |
| 8 | } |
no outgoing calls
no test coverage detected