MCPcopy
hub / github.com/angular/angular / removeAssetFromCache

Function removeAssetFromCache

packages/service-worker/worker/test/happy_spec.ts:2864–2875  ·  view source on GitHub ↗
(
  scope: SwTestHarness,
  appVersionManifest: Manifest,
  assetPath: string,
)

Source from the content-addressed store, hash-verified

2862})();
2863
2864async function removeAssetFromCache(
2865 scope: SwTestHarness,
2866 appVersionManifest: Manifest,
2867 assetPath: string,
2868) {
2869 const assetGroupName = appVersionManifest.assetGroups?.find((group) =>
2870 group.urls.includes(assetPath),
2871 )?.name;
2872 const cacheName = `${sha1(JSON.stringify(appVersionManifest))}:assets:${assetGroupName}:cache`;
2873 const cache = await scope.caches.open(cacheName);
2874 return cache.delete(assetPath);
2875}
2876
2877async function makeRequest(
2878 scope: SwTestHarness,

Callers 1

happy_spec.tsFile · 0.85

Calls 4

sha1Function · 0.90
openMethod · 0.65
findMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…