| 62222 | * @type {Map<string, import('./cache').requestResponseList} |
| 62223 | */ |
| 62224 | #caches = /* @__PURE__ */ new Map(); |
| 62225 | constructor() { |
| 62226 | if (arguments[0] !== kConstruct) { |
| 62227 | webidl.illegalConstructor(); |
| 62228 | } |
| 62229 | } |
| 62230 | async match(request3, options = {}) { |
| 62231 | webidl.brandCheck(this, _CacheStorage); |
| 62232 | webidl.argumentLengthCheck(arguments, 1, { header: "CacheStorage.match" }); |
| 62233 | request3 = webidl.converters.RequestInfo(request3); |
| 62234 | options = webidl.converters.MultiCacheQueryOptions(options); |
| 62235 | if (options.cacheName != null) { |
| 62236 | if (this.#caches.has(options.cacheName)) { |
| 62237 | const cacheList = this.#caches.get(options.cacheName); |
| 62238 | const cache = new Cache(kConstruct, cacheList); |
| 62239 | return await cache.match(request3, options); |
| 62240 | } |
| 62241 | } else { |
| 62242 | for (const cacheList of this.#caches.values()) { |
| 62243 | const cache = new Cache(kConstruct, cacheList); |
| 62244 | const response = await cache.match(request3, options); |
| 62245 | if (response !== void 0) { |
| 62246 | return response; |
| 62247 | } |