Function
getResponseHeader
(
response: AxiosResponse<unknown>,
responseHeader?: string,
)
Source from the content-addressed store, hash-verified
| 223 | } |
| 224 | |
| 225 | export const getResponseHeader = ( |
| 226 | response: AxiosResponse<unknown>, |
| 227 | responseHeader?: string, |
| 228 | ): string | undefined => { |
| 229 | if (responseHeader) { |
| 230 | const content = response.headers[responseHeader] |
| 231 | if (isString(content)) { |
| 232 | return content |
| 233 | } |
| 234 | } |
| 235 | return undefined |
| 236 | } |
| 237 | |
| 238 | export const getResponseBody = (response: AxiosResponse<unknown>): unknown => { |
| 239 | if (response.status !== 204) { |
Tested by
no test coverage detected