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

Method keys

github-actions/bazel/configure-remote/configure-remote.js:16079–16123  ·  view source on GitHub ↗

* @see https://w3c.github.io/ServiceWorker/#dom-cache-keys * @param {any} request * @param {import('../../types/cache').CacheQueryOptions} options * @returns {Promise }

()

Source from the content-addressed store, hash-verified

16077 webidl.brandCheck(this, _Cache);
16078 const prefix = "Cache.delete";
16079 webidl.argumentLengthCheck(arguments, 1, prefix);
16080 request = webidl.converters.RequestInfo(request, prefix, "request");
16081 options = webidl.converters.CacheQueryOptions(options, prefix, "options");
16082 let r = null;
16083 if (request instanceof Request) {
16084 r = request[kState];
16085 if (r.method !== "GET" && !options.ignoreMethod) {
16086 return false;
16087 }
16088 } else {
16089 assert(typeof request === "string");
16090 r = new Request(request)[kState];
16091 }
16092 const operations = [];
16093 const operation = {
16094 type: "delete",
16095 request: r,
16096 options
16097 };
16098 operations.push(operation);
16099 const cacheJobPromise = createDeferredPromise();
16100 let errorData = null;
16101 let requestResponses;
16102 try {
16103 requestResponses = __privateMethod(this, _batchCacheOperations, batchCacheOperations_fn).call(this, operations);
16104 } catch (e) {
16105 errorData = e;
16106 }
16107 queueMicrotask(() => {
16108 if (errorData === null) {
16109 cacheJobPromise.resolve(!!(requestResponses == null ? void 0 : requestResponses.length));
16110 } else {
16111 cacheJobPromise.reject(errorData);
16112 }
16113 });
16114 return cacheJobPromise.promise;
16115 });
16116 }
16117 /**
16118 * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys
16119 * @param {any} request
16120 * @param {import('../../types/cache').CacheQueryOptions} options
16121 * @returns {Promise<readonly Request[]>}
16122 */
16123 keys() {
16124 return __async(this, arguments, function* (request = void 0, options = {}) {
16125 webidl.brandCheck(this, _Cache);
16126 const prefix = "Cache.keys";

Callers 12

mergeOptionsFunction · 0.45
constructorMethod · 0.45
setMethod · 0.45
enumToMapFunction · 0.45
""Function · 0.45
cleanRequestHeadersFunction · 0.45
throwIfProxyAuthIsSentFunction · 0.45
generateKeyValuesFunction · 0.45
fillFunction · 0.45
constructorMethod · 0.45
keysMethod · 0.45
toStringMethod · 0.45

Calls 6

__asyncFunction · 0.70
createDeferredPromiseFunction · 0.70
__privateGetFunction · 0.70
__privateMethodFunction · 0.70
fromInnerRequestFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected