MCPcopy
hub / github.com/angular/angular / 'delete'

Method 'delete'

packages/service-worker/worker/testing/cache.ts:118–132  ·  view source on GitHub ↗
(request: RequestInfo, options?: CacheQueryOptions)

Source from the content-addressed store, hash-verified

116 }
117
118 async 'delete'(request: RequestInfo, options?: CacheQueryOptions): Promise<boolean> {
119 let url = this.getRequestUrl(request);
120 if (this.cache.has(url)) {
121 this.cache.delete(url);
122 return true;
123 } else if (options?.ignoreSearch) {
124 url = this.stripQueryAndHash(url);
125 const cachedUrl = [...this.cache.keys()].find((key) => url === this.stripQueryAndHash(key));
126 if (cachedUrl) {
127 this.cache.delete(cachedUrl);
128 return true;
129 }
130 }
131 return false;
132 }
133
134 async keys(match?: Request | string): Promise<string[]> {
135 if (match !== undefined) {

Callers

nothing calls this directly

Calls 6

getRequestUrlMethod · 0.95
stripQueryAndHashMethod · 0.95
hasMethod · 0.65
keysMethod · 0.65
deleteMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected