typelab / assertions / IsExtendsEitherWay
type IsExtendsEitherWay<T1, T2> = _IsTrue<IfExtendsEitherWay<T1, T2, true, false>>;Type that checks if type T1 extends type T2 or type T2 extends type T1.
| Type Parameter | Description |
|---|---|
|
|
The first type to compare. |
|
|
The second type to compare. |
true if either conditions are true, false otherwise.
type Relate = IsExtendsEitherWay<string, ''>; // true
type NotRelate = IsExtendsEitherWay<string, number>; // false