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
* Implement the util type `If<C, T, F>` which accepts condition `C`, a truthy value `T`, and a falsy value `F`. `C` is expected to be either `true` or `false` while `T` and `F` can be any type.
*
* For example:
*
* ```ts
* type A = If<true, 'a', 'b'> // expected to be 'a'
* type B = If<false, 'a', 'b'> // expected to be 'b'
* ```
*/
/* _____________ Your Code Here _____________ */
type If<C extends boolean, T, F> = C extends true
? T
: F
/* _____________ Test Cases _____________ */
import type { Equal, Expect } from '@type-challenges/utils'