-
-
Notifications
You must be signed in to change notification settings - Fork 613
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
base: main
Are you sure you want to change the base?
Conversation
IsNumericLike
IsNumericLike
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>
//=> any IMO, |
IsNumericLike
and fix UnionMin
typesIsNumericLike
and fix UnionMin
, UnionMax
types
e780458
to
12f2ef4
Compare
@som-sm should |
…type-fest into numeric-like/union-min
IsNumericLike
that cosed an error and add cases fornever
/any
.UnionMin
toUnionMax
returning0
fornever
,any
fornumber
, erroring forany
andInfinity
.IsAnyOrNever
type alternative forIfNotAnyOrNever
. (internal)Original behavior:
Current behavior: