New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing an issue that type 'null' and 'undefined' is not assignable to validateStatus when typescript strict option is enabled #3200
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your update. And in order to avoid similar mistakes, can you update the test file with a new case? In addition, validateStatus?
has included undefined
I think.
@cprayer Ping for updating. |
… validateStatus when typescript strict option is enabled
fe85e35
to
89c40f3
Compare
@chinesedfan Before -> validateStatus?: ((status: number) => boolean | null)
After - validateStatus?: ((status: number) => boolean) | null
TS2345 Error of line 341, 345 is irrelevant to the validateStatus option. So I don't care about this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be a good solution to this issue.
… validateStatus when typescript strict option is enabled (axios#3200)
In previous my PR(#2773), I had missed about two things.
So I fix above things in this PR.