Function
getResponseHeader
(response: Response, responseHeader?: string)
Source from the content-addressed store, hash-verified
| 220 | }; |
| 221 | |
| 222 | export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => { |
| 223 | if (responseHeader) { |
| 224 | const content = response.headers.get(responseHeader); |
| 225 | if (isString(content)) { |
| 226 | return content; |
| 227 | } |
| 228 | } |
| 229 | return undefined; |
| 230 | }; |
| 231 | |
| 232 | export const getResponseBody = async (response: Response): Promise<any> => { |
| 233 | if (response.status !== 204) { |
Tested by
no test coverage detected