(request: RequestInfo, options?: CacheQueryOptions)
| 139 | } |
| 140 | |
| 141 | async match(request: RequestInfo, options?: CacheQueryOptions): Promise<Response> { |
| 142 | let url = this.getRequestUrl(request); |
| 143 | let res = this.cache.get(url); |
| 144 | if (!res && options?.ignoreSearch) { |
| 145 | // check if cache has url by ignoring search |
| 146 | url = this.stripQueryAndHash(url); |
| 147 | const matchingReq = [...this.cache.keys()].find((key) => url === this.stripQueryAndHash(key)); |
| 148 | if (matchingReq !== undefined) res = this.cache.get(matchingReq); |
| 149 | } |
| 150 | |
| 151 | if (res !== undefined) { |
| 152 | res = res.clone(); |
| 153 | } |
| 154 | return res!; |
| 155 | } |
| 156 | |
| 157 | async matchAll(request?: Request | string, options?: CacheQueryOptions): Promise<Response[]> { |
| 158 | if (request === undefined) { |
no test coverage detected