MCPcopy
hub / github.com/angular/angular / normalizeUrl

Method normalizeUrl

packages/service-worker/worker/src/adapter.ts:84–88  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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`.

Callers 8

constructorFunction · 0.80
handleFetchFunction · 0.80
unhashedResourcesFunction · 0.80
fetchAndCacheOnceFunction · 0.80
maybeUpdateFunction · 0.80
constructorMethod · 0.80
handleFetchMethod · 0.80

Calls 1

parseUrlMethod · 0.95

Tested by

no test coverage detected