-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix type guard additions #2170
Fix type guard additions #2170
Conversation
…rst, last type guard specs
1 similar comment
Cc/ @david-driscoll can you review? |
I swear I had tried overload ordering the other day to validate if this was possible. I tried again just now and these changes seem to be working just fine. 👍 cc @saneyuki for an extra set of 👀 |
@david-driscoll Yep, the ordering is definitely necessary! It wasn't enough, though, so there are some strategic non-optional function parameters in there, too, to help typescript resolve certain cases. |
I confirmed that in #2164 we need to write the version which takes Is it resolved in this? The current patches are not care about them. |
@saneyuki That's what I originally thought, too. Surprisingly, it turns out that |
LGTM |
Thanks so much, @rob3c!! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description:
This is a fix for the recently-added type guard support in the
filter
,find
,first
andlast
operator typings. Please see the test cases for details of what's working now, and be sure to let me know if I missed anything this time! ;-)Related issue (if exists):
Apparently, my previous PR in #2119 is being reverted in #2164 due to the important missed case mentioned in #2163. Unfortunately, I didn't receive any notifications about it, but I'm glad I saw it today while lurking through the repo! :-) Hopefully, this PR should address the problem (which I'm embarrased that I missed), and let us keep the new support without breaking previous behavior.