Maintain modifiers on Omit (#31205)

Maintain modifiers on `Omit`
This commit is contained in:
Daniel Rosenwasser
2019-05-10 10:03:48 -07:00
committed by GitHub
16 changed files with 273 additions and 51 deletions

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

@@ -1446,9 +1446,7 @@ 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> = {
[P in Exclude<keyof T, K>]: T[P]
};
type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;
/**
* Exclude null and undefined from T