Method
responseToStoreType
(
response: Response,
storetype?: StoreType,
)
Source from the content-addressed store, hash-verified
| 670 | } |
| 671 | |
| 672 | private async responseToStoreType( |
| 673 | response: Response, |
| 674 | storetype?: StoreType, |
| 675 | ): Promise<any> { |
| 676 | if (storetype === undefined) { |
| 677 | return response; |
| 678 | } |
| 679 | const format = storetype.toLowerCase(); |
| 680 | if (format === "json") { |
| 681 | return response.json(); |
| 682 | } |
| 683 | if (format === "arraybuffer") { |
| 684 | return response.arrayBuffer(); |
| 685 | } |
| 686 | return response; |
| 687 | } |
| 688 | } |
| 689 | |
| 690 | /** |
Tested by
no test coverage detected