-
Notifications
You must be signed in to change notification settings - Fork 10
Conditional
Michael Poteat edited this page Feb 27, 2023
·
3 revisions
hkt-toolbelt / Conditional
Ƭ _$equals<T
, U
>: [T
, U
] extends [U
, T
] ? true
: false
Name |
---|
T |
U |
Ƭ _$extends<T
, X
>: X
extends unknown
? X
: never
extends T
? true
: false
Name |
---|
T |
X |
Ƭ _$if<Predicate
, Then
, Else
, X
>: $
<Predicate
, X
> extends true
? $
<Then
, _$cast
<X
, _$inputOf
<Then
>>> : $
<Else
, _$cast
<X
, _$inputOf
<Else
>>>
Name | Type |
---|---|
Predicate |
extends Kind <(x : never ) => boolean > |
Then |
extends Kind
|
Else |
extends Kind
|
X |
extends _$inputOf <Predicate > |
Ƭ _$notEquals<T
, U
>: [T
, U
] extends [U
, T
] ? false
: true
Name |
---|
T |
U |