Extracts from union type T those types that are assignable to U. This is a relaxed version that doesn't require U to extend T.
T
U
The union type to extract from.
The type to extract.
The intersection of T and U.
type Union = 'a' | 'b' | 'c';type Extracted = RelaxedExtract<Union, 'a' | 'd'>; // 'a'type Numbers = RelaxedExtract<string | number | boolean, number>; // number Copy
type Union = 'a' | 'b' | 'c';type Extracted = RelaxedExtract<Union, 'a' | 'd'>; // 'a'type Numbers = RelaxedExtract<string | number | boolean, number>; // number
Extracts from union type
Tthose types that are assignable toU. This is a relaxed version that doesn't requireUto extendT.