MCPcopy
hub / github.com/angular/angular / constructor

Method constructor

packages/service-worker/worker/src/adapter.ts:22–35  ·  view source on GitHub ↗
(
    protected readonly scopeUrl: string,
    caches: T,
  )

Source from the content-addressed store, hash-verified

20 readonly origin: string;
21
22 constructor(
23 protected readonly scopeUrl: string,
24 caches: T,
25 ) {
26 const parsedScopeUrl = this.parseUrl(this.scopeUrl);
27
28 // Determine the origin from the registration scope. This is used to differentiate between
29 // relative and absolute URLs.
30 this.origin = parsedScopeUrl.origin;
31
32 // Use the baseHref in the cache name prefix to avoid clash of cache names for SWs with
33 // different scopes on the same domain.
34 this.caches = new NamedCacheStorage(caches, `ngsw:${parsedScopeUrl.path}`);
35 }
36
37 /**
38 * Wrapper around the `Request` constructor.

Callers

nothing calls this directly

Calls 1

parseUrlMethod · 0.95

Tested by

no test coverage detected