MCPcopy Create free account
hub / github.com/angular/dev-infra / delete

Method delete

github-actions/saucelabs/set-saucelabs-env.js:16031–16072  ·  view source on GitHub ↗
(_0)

Source from the content-addressed store, hash-verified

16029 });
16030 }
16031 delete(_0) {
16032 return __async(this, arguments, function* (request, options = {}) {
16033 webidl.brandCheck(this, _Cache);
16034 const prefix = "Cache.delete";
16035 webidl.argumentLengthCheck(arguments, 1, prefix);
16036 request = webidl.converters.RequestInfo(request, prefix, "request");
16037 options = webidl.converters.CacheQueryOptions(options, prefix, "options");
16038 let r = null;
16039 if (request instanceof Request) {
16040 r = request[kState];
16041 if (r.method !== "GET" && !options.ignoreMethod) {
16042 return false;
16043 }
16044 } else {
16045 assert(typeof request === "string");
16046 r = new Request(request)[kState];
16047 }
16048 const operations = [];
16049 const operation = {
16050 type: "delete",
16051 request: r,
16052 options
16053 };
16054 operations.push(operation);
16055 const cacheJobPromise = createDeferredPromise();
16056 let errorData = null;
16057 let requestResponses;
16058 try {
16059 requestResponses = __privateMethod(this, _batchCacheOperations, batchCacheOperations_fn).call(this, operations);
16060 } catch (e) {
16061 errorData = e;
16062 }
16063 queueMicrotask(() => {
16064 if (errorData === null) {
16065 cacheJobPromise.resolve(!!(requestResponses == null ? void 0 : requestResponses.length));
16066 } else {
16067 cacheJobPromise.reject(errorData);
16068 }
16069 });
16070 return cacheJobPromise.promise;
16071 });
16072 }
16073 /**
16074 * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys
16075 * @param {any} request

Callers 14

performUnblockFunction · 0.45
testApiGoldenFunction · 0.45
constructorMethod · 0.45
setMethod · 0.45
[kClose]Method · 0.45
runLookupMethod · 0.45
deleteMethod · 0.45
deleteMethod · 0.45
abortFunction · 0.45
httpRedirectFetchFunction · 0.45

Calls 4

__asyncFunction · 0.70
createDeferredPromiseFunction · 0.70
__privateMethodFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected