typelab / assertions / IsExtends
type IsExtends<T1, T2> = _IsTrue<IfExtends<T1, T2, true, false>>;Type that checks if type T1 extends type T2.
| Type Parameter | Description |
|---|---|
|
|
The first type to compare. |
|
|
The second type to compare. |
true if T1 is assignable to T2 (i.e., T1 extends T2), false otherwise.
type Extends = IsExtends<'', string>; // true
type NotExtends = IsExtends<string, ''>; // false