Add the Omit helper type.

This commit is contained in:
Daniel Rosenwasser
2019-04-04 10:01:34 -07:00
committed by Daniel Rosenwasser
parent b8f6ae4e25
commit 13d2b8d617
+5
View File
@@ -1443,6 +1443,11 @@ type Exclude<T, U> = T extends U ? never : T;
*/
type Extract<T, U> = T extends U ? T : never;
/**
* Construct a type with the properties of T except for those in type K.
*/
type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;
/**
* Exclude null and undefined from T
*/