Navigation Menu

Skip to content

Commit

Permalink
Make Omit alias its own mapped type so that references to it never …
Browse files Browse the repository at this point in the history
…expand to `Pick<...>`.
  • Loading branch information
DanielRosenwasser committed Apr 24, 2019
1 parent 622cb42 commit 57938e6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/es5.d.ts
Expand Up @@ -1446,7 +1446,9 @@ 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>>;
type Omit<T, K extends keyof any> = {
[P in Exclude<keyof T, K>]: T[P]
};

/**
* Exclude null and undefined from T
Expand Down

0 comments on commit 57938e6

Please sign in to comment.