Type Alias UnionType<T, Then, Else>

UnionType<T, Then, Else>: UnionType.Device<T, Then, Else>

🌪️ filter

Filter the type T to ensure it is a union.

Type Parameters

  • T
  • Then = T
  • Else = never
type R = IsUnion<'a' | 'b'> // 'a' | 'b'
type R = IsUnion<boolean> // boolean
type R = IsUnion<number> // never