Make Omit alias its own mapped type so that references to it never expand to Pick<...>.

This commit is contained in:
Daniel Rosenwasser 2019-04-24 16:57:20 -07:00
parent 622cb42137
commit 57938e6cc2

4
src/lib/es5.d.ts vendored
View File

@ -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