MCPcopy
hub / github.com/angular/angular / dehydrate

Method dehydrate

packages/service-worker/worker/testing/cache.ts:180–198  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

178 }
179
180 dehydrate(): DehydratedCache {
181 const dehydrated: DehydratedCache = {};
182 Array.from(this.cache.keys()).forEach((url) => {
183 const resp = this.cache.get(url) as MockResponse;
184 const dehydratedResp = {
185 body: resp._body,
186 status: resp.status,
187 statusText: resp.statusText,
188 headers: {},
189 } as DehydratedResponse;
190
191 resp.headers.forEach((value: string, name: string) => {
192 dehydratedResp.headers[name] = value;
193 });
194
195 dehydrated[url] = dehydratedResp;
196 });
197 return dehydrated;
198 }
199
200 /** Get the normalized URL from a `RequestInfo` value. */
201 private getRequestUrl(request: RequestInfo): string {

Callers 4

prefetch_spec.tsFile · 0.45
happy_spec.tsFile · 0.45
getClientAssignmentsFunction · 0.45
dehydrateMethod · 0.45

Calls 3

keysMethod · 0.65
getMethod · 0.65
forEachMethod · 0.45

Tested by

no test coverage detected