typelab / assertions / IsIntersected
type IsIntersected<T1, T2> = IfIntersected<T1, T2, true, false>;Checks if type T1 is intersected with type T2.
| Type Parameter | Description |
|---|---|
|
|
The first type to compare. |
|
|
The second type to compare. |
true if T1 & T2 is not never, false otherwise.
type Intersected = IsIntersected<'a' | 'c', 'a' | 'b'>; // true
type NotIntersected = IsIntersected<'c', 'a' | 'b'>; // false