* Parse a URL into its different parts, such as `origin`, `path` and `search`.
(url: string, relativeTo?: string)
| 91 | * Parse a URL into its different parts, such as `origin`, `path` and `search`. |
| 92 | */ |
| 93 | parseUrl(url: string, relativeTo?: string): {origin: string; path: string; search: string} { |
| 94 | // Workaround a Safari bug, see |
| 95 | // https://github.com/angular/angular/issues/31061#issuecomment-503637978 |
| 96 | const parsed = !relativeTo ? new URL(url) : new URL(url, relativeTo); |
| 97 | return {origin: parsed.origin, path: parsed.pathname, search: parsed.search}; |
| 98 | } |
| 99 | |
| 100 | /** |
| 101 | * Wait for a given amount of time before completing a Promise. |
no outgoing calls
no test coverage detected