(url: string, storetype?: string)
| 623 | } |
| 624 | |
| 625 | private async readFromCache(url: string, storetype?: string): Promise<any> { |
| 626 | if (storetype?.toLowerCase() === "arraybuffer") { |
| 627 | const cachedData = await this.store.readArrayBuffer(url); |
| 628 | if (cachedData === undefined) { |
| 629 | throw new Error("ArtifactOPFSCache failed to fetch: " + url); |
| 630 | } |
| 631 | return cachedData; |
| 632 | } |
| 633 | const cachedResponse = await this.store.read(url); |
| 634 | if (cachedResponse === undefined) { |
| 635 | throw new Error("ArtifactOPFSCache failed to fetch: " + url); |
| 636 | } |
| 637 | return this.responseToStoreType(cachedResponse, storetype); |
| 638 | } |
| 639 | |
| 640 | async addToCache( |
| 641 | url: string, |
no test coverage detected