mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Make Omit alias its own mapped type so that references to it never expand to Pick<...>.
This commit is contained in:
Vendored
+3
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user