* Helper function to convert a response body to an ArrayBuffer.
( body: ArrayBuffer | Blob | string | number | Object | (string | number | Object | null)[], )
| 146 | * Helper function to convert a response body to an ArrayBuffer. |
| 147 | */ |
| 148 | function _toArrayBufferBody( |
| 149 | body: ArrayBuffer | Blob | string | number | Object | (string | number | Object | null)[], |
| 150 | ): ArrayBuffer { |
| 151 | if (typeof ArrayBuffer === 'undefined') { |
| 152 | throw new Error('ArrayBuffer responses are not supported on this platform.'); |
| 153 | } |
| 154 | if (body instanceof ArrayBuffer) { |
| 155 | return body; |
| 156 | } |
| 157 | throw new Error('Automatic conversion to ArrayBuffer is not supported for response type.'); |
| 158 | } |
| 159 | |
| 160 | /** |
| 161 | * Helper function to convert a response body to a Blob. |
no outgoing calls
no test coverage detected
searching dependent graphs…