(response: Response)
| 41 | } |
| 42 | |
| 43 | async function parseJsonResponse(response: Response) { |
| 44 | const json = await response.json(); |
| 45 | if (!response.ok) { |
| 46 | return Promise.reject(json); |
| 47 | } |
| 48 | return json; |
| 49 | } |
| 50 | |
| 51 | export function parseResponse(response: Response) { |
| 52 | const contentType = response.headers.get('Content-Type'); |