MCPcopy Index your code
hub / github.com/angular/angular / normalizeUrl

Function normalizeUrl

packages/service-worker/worker/testing/utils.ts:33–38  ·  view source on GitHub ↗
(url: string, relativeTo: string)

Source from the content-addressed store, hash-verified

31 * @return A normalized representation of the URL.
32 */
33export function normalizeUrl(url: string, relativeTo: string): NormalizedUrl {
34 const {origin, path, search} = parseUrl(url, relativeTo);
35 const {origin: relativeToOrigin} = parseUrl(relativeTo);
36
37 return (origin === relativeToOrigin ? path + search : url) as NormalizedUrl;
38}
39
40/**
41 * Parse a URL into its different parts, such as `origin`, `path` and `search`.

Callers 3

getRequestUrlMethod · 0.90
fetchMethod · 0.90
newRequestMethod · 0.90

Calls 1

parseUrlFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…