-
Notifications
You must be signed in to change notification settings - Fork 10
Union
Michael Poteat edited this page Feb 27, 2023
·
3 revisions
hkt-toolbelt / Union
Ƭ _$length<T
>: _$isNever
<T
> extends true
? 0
: _$toList
<T
> extends infer X ? X
["length"
] : never
Name |
---|
T |
Ƭ _$toIntersection<T
>: boolean
extends T
? boolean
& _$toIntersection2
<Exclude
<T
, boolean
>> : _$toIntersection2
<T
>
Name |
---|
T |
Ƭ _$toList<T
, O
>: _$toIntersection
<T
extends unknown
? (t
: T
) => T
: never
> extends (x
: never
) => infer X ? _$toList
<Exclude
<T
, X
>, [X
, ...O]> : O
Name | Type |
---|---|
T |
T |
O |
extends unknown [] = [] |