typelab / utils / UnionExclusive
type UnionExclusive<U1, U2> = Exclude<U1, U2> | Exclude<U2, U1>;Creates a union of types that are exclusive to each other.
| Type Parameter | Description |
|---|---|
|
|
The first union. |
|
|
The second union. |
A union of types that excludes common types from both unions.
// 'a' | 'c'
type Exclusive = UnionExclusive<'a' | 'b', 'b' | 'c'>;