(key: string)
| 75 | } |
| 76 | |
| 77 | read(key: string): Promise<any> { |
| 78 | return this.cache.match(this.request(key), this.cacheQueryOptions).then((res) => { |
| 79 | if (res === undefined) { |
| 80 | return Promise.reject(new NotFound(this.name, key)); |
| 81 | } |
| 82 | return res.json(); |
| 83 | }); |
| 84 | } |
| 85 | |
| 86 | write(key: string, value: Object): Promise<void> { |
| 87 | return this.cache.put(this.request(key), this.adapter.newResponse(JSON.stringify(value))); |