Type alias If<C, Do, Else>

If<C, Do, Else>: IfExtends<C, true, Do, Else>

Conditional type: if the condition C is true, return Do, otherwise return Else.

Type Parameters

  • C extends boolean
  • Do
  • Else

Example

  If<IsNever<never>, true, false>; // true
If<Not<IsNever<never>>, true, false>; // false