* Get a normalized representation of a URL such as those found in the ServiceWorker's `ngsw.json` * configuration. * * More specifically: * 1. Resolve the URL relative to the ServiceWorker's scope. * 2. If the URL is relative to the ServiceWorker's own origin, then only return the pat
(url: string)
| 82 | * @return A normalized representation of the URL. |
| 83 | */ |
| 84 | normalizeUrl(url: string): NormalizedUrl { |
| 85 | // Check the URL's origin against the ServiceWorker's. |
| 86 | const parsed = this.parseUrl(url, this.scopeUrl); |
| 87 | return (parsed.origin === this.origin ? parsed.path : url) as NormalizedUrl; |
| 88 | } |
| 89 | |
| 90 | /** |
| 91 | * Parse a URL into its different parts, such as `origin`, `path` and `search`. |
no test coverage detected