-
-
Notifications
You must be signed in to change notification settings - Fork 647
refactor IsNumericLike and fix UnionMin, UnionMax types
#1192
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
refactor IsNumericLike and fix UnionMin, UnionMax types
#1192
Conversation
IsNumericLikeIsNumericLike and fix UnionMin types
fix: match behavior of `UnionMin` to `UnionMax` returning `0` for `never`
29d7761 to
ca7eca2
Compare
a240e8d to
91a2378
Compare
|
Reason to introduce type CountTo<T> = count to T;
type Count1<T> = IfNotAnyOrNever<T, CountTo>;
type Count2<T> = IsAnyOrNever<T> extends true ? T : CountTo<T>;
type A = Count1<any>
// ~~~~~~~~~~
// Error: Type instantiation is excessively deep and possibly infinite.
type B = Count2<any>
//=> anyIMO, |
IsNumericLike and fix UnionMin typesIsNumericLike and fix UnionMin, UnionMax types
e780458 to
12f2ef4
Compare
|
@som-sm should |
I think it should stay |
IsNumericLikethat cosed an error and add cases fornever/any.UnionMintoUnionMaxreturning0fornever,anyfornumber, erroring foranyandInfinity.IsAnyOrNevertype alternative forIfNotAnyOrNever. (internal)Original behavior:
Current behavior: