You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
response.headers.hasContentType() (where response: axios.AxiosResponse<any, any>) raises 2 illegitimate TS errors although this expression works as expected:
Cannot invoke an object which is possibly 'null' or 'undefined'. ts(2723)
This expression is not callable. ts(2349)
Not all constituents of type 'string | number | boolean | AxiosHeaders | string[] | ((matcher?: AxiosHeaderMatcher | undefined) => boolean)' are callable.
Type 'string' has no call signatures.
response.headers.hasContentType() (where response: axios.AxiosResponse<any, any>) shouldn't raise any TS error and be recognized as a boolean by TypeScript.
Axios Version
1.6.7
Adapter Version
No response
Browser
No response
Browser Version
No response
Node.js Version
21.6.2
OS
No response
Additional Library Versions
TypeScript 5.3.3
Additional context/Screenshots
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
response.headers.hasContentType()
(whereresponse: axios.AxiosResponse<any, any>
) raises 2 illegitimate TS errors although this expression works as expected:To Reproduce
e.g. https://codesandbox.io/p/devbox/lucid-dawn-82cn7d
tsc
in a Terminal to raise the TS errors.node src/index.js
to confirm that the code works.Code snippet
Expected behavior
response.headers.hasContentType()
(whereresponse: axios.AxiosResponse<any, any>
) shouldn't raise any TS error and be recognized as a boolean by TypeScript.Axios Version
1.6.7
Adapter Version
No response
Browser
No response
Browser Version
No response
Node.js Version
21.6.2
OS
No response
Additional Library Versions
Additional context/Screenshots
No response
The text was updated successfully, but these errors were encountered: