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
I checked separately if it had to do with the FirstBy type but that doesn't seem to be the case:
constk1=pipe([{x: 10},{x: 20}],firstBy(prop("x")));// FirstBy<{x: number; }[]>, as expectedtypet1=Extract<typeofk1,null|undefined>;// undefined, as expectedtypet2=NonNullable<typeofk1>;// {x: number; }, as expected
It looks like the conditional's Whens must be a type guard of the form is A where A is a primitive type, so not even "NonNullable". Is this correct and intended? If so, it would be good to reflect this in the documentation.
The text was updated successfully, but these errors were encountered:
JeongJuhyeon
changed the title
Unexpected behavior when using isNullish/isNonNullish in conditional
Unexpected types when using isNullish/isNonNullish in conditional
May 8, 2024
TS Version: 5.4.5
Example:
I checked separately if it had to do with the FirstBy type but that doesn't seem to be the case:
It looks like the conditional's
When
s must be a type guard of the formis A
whereA
is a primitive type, so not even "NonNullable". Is this correct and intended? If so, it would be good to reflect this in the documentation.The text was updated successfully, but these errors were encountered: