mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Add the Omit helper type.
This commit is contained in:
committed by
Daniel Rosenwasser
parent
b8f6ae4e25
commit
13d2b8d617
Vendored
+5
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user