Skip to content

Latest commit

 

History

History
55 lines (39 loc) · 676 Bytes

File metadata and controls

55 lines (39 loc) · 676 Bytes

typelab / assertions / IsExtends

type IsExtends<T1, T2> = _IsTrue<IfExtends<T1, T2, true, false>>;

Type that checks if type T1 extends type T2.

Type Parameters

Type Parameter Description

T1

The first type to compare.

T2

The second type to compare.

Returns

true if T1 is assignable to T2 (i.e., T1 extends T2), false otherwise.

Example

type Extends = IsExtends<'', string>; // true
type NotExtends = IsExtends<string, ''>; // false