Skip to content

Commit

Permalink
Add the Omit helper type.
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRosenwasser authored Mar 22, 2019
1 parent 0f6f3b7 commit 53e76b3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/es5.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit 53e76b3

Please sign in to comment.