Extraire et exclure Type TypeScript
type Extract<T, U> = T extends U ? T : never;
type Exclude<T, U> = T extends U ? never : T;
type a = Exclude<'a' | 'b' | 'c', 'a'>;//'b' | 'c'
type b = Extract<'a' | 'b' | 'c', 'a' | 'b'>; // 'a' | 'b'
Husnain Syed