feature: Add type predicates to isEmpty and isNotEmpty functions #2429
pemakhov
started this conversation in
Feature Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
To use isEmpty or isNotEmpty in type guards these functions should return type predicates.
In the following example there will be typescript error in the line
return a + b
even though we have previously checked "a" and "b" were not empty.I propose to alter isEmpty and isNotEmpty to return type predicates.
Beta Was this translation helpful? Give feedback.
All reactions