The potentially narrower type
The potentially broader type
type Test1 = Extends<string, any>; // true
type Test2 = Extends<"hello", string>; // true (literal extends base)
type Test3 = Extends<string, number>; // false
type Test4 = Extends<never, string>; // true (never extends everything)
type Test5 = Extends<{a: 1, b: 2}, {a: 1}>; // true (subtype extends supertype)
Utility type to check if one type extends another (subtype relationship). Equivalent to
SubType extends SuperType ? true : false.