* Helper function to convert a response body to a Blob.
( body: ArrayBuffer | Blob | string | number | Object | (string | number | Object | null)[], )
| 161 | * Helper function to convert a response body to a Blob. |
| 162 | */ |
| 163 | function _toBlob( |
| 164 | body: ArrayBuffer | Blob | string | number | Object | (string | number | Object | null)[], |
| 165 | ): Blob { |
| 166 | if (typeof Blob === 'undefined') { |
| 167 | throw new Error('Blob responses are not supported on this platform.'); |
| 168 | } |
| 169 | if (body instanceof Blob) { |
| 170 | return body; |
| 171 | } |
| 172 | if (ArrayBuffer && body instanceof ArrayBuffer) { |
| 173 | return new Blob([body]); |
| 174 | } |
| 175 | throw new Error('Automatic conversion to Blob is not supported for response type.'); |
| 176 | } |
| 177 | |
| 178 | /** |
| 179 | * Helper function to convert a response body to JSON data. |
no outgoing calls
no test coverage detected
searching dependent graphs…