(req: Request)
| 54 | } |
| 55 | |
| 56 | async match(req: Request): Promise<Response | undefined> { |
| 57 | return await Array.from(this.caches.values()).reduce<Promise<Response | undefined>>( |
| 58 | async (answer, cache): Promise<Response | undefined> => { |
| 59 | const curr = await answer; |
| 60 | if (curr !== undefined) { |
| 61 | return curr; |
| 62 | } |
| 63 | |
| 64 | return cache.match(req); |
| 65 | }, |
| 66 | Promise.resolve<Response | undefined>(undefined), |
| 67 | ); |
| 68 | } |
| 69 | |
| 70 | async 'delete'(name: string): Promise<boolean> { |
| 71 | if (this.caches.has(name)) { |