Maintain modifiers on Omit (#31205)

Maintain modifiers on `Omit`
This commit is contained in:
Daniel Rosenwasser authored and GitHub committed 2019-05-10 10:03:48 -07:00
commit 39e9a2bb4f
16 files changed
+273 -51

No files matched your search

+1 -3
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