(url?: string)
| 62 | * Return the BaseUriParts for either the given url or the global window |
| 63 | */ |
| 64 | export function parseUriIntoBaseParts(url?: string): URL { |
| 65 | const currentUrl = new URL(url ?? window.location.href) |
| 66 | |
| 67 | currentUrl.pathname = currentUrl.pathname |
| 68 | .replace(FINAL_SLASH_RE, "") |
| 69 | .replace(INITIAL_SLASH_RE, "") |
| 70 | |
| 71 | return currentUrl |
| 72 | } |
| 73 | |
| 74 | // NOTE: In the multipage apps world, there is some ambiguity around whether a |
| 75 | // path like "foo/bar" means |
no outgoing calls
no test coverage detected
searching dependent graphs…