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
{{ message }}
Repository navigation
Negated {} and null | undefined predicates on unknown should still narrowΒ #60789
declarefunctionisNotNullish(value: unknown): value is {};declarefunctionisNullish(value: unknown): value is null|undefined;declareconstvalue: unknown;if(isNotNullish(value)){value;// ^?}if(!isNotNullish(value)){value;// ^?}if(isNullish(value)){value;// ^?}if(!isNullish(value)){value;// ^?}
π Actual behavior
value only narrows when the type predicate is called directly, not when negated with a !.
Activity
Andarist commentedon Dec 17, 2024
Using
unknownis so 2024: TS playgroundJoshuaKGoldberg commentedon Dec 18, 2024
What a ridiculously fast turnaround time. β€οΈ