We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Omit
1 parent e6d5043 commit b3e991eCopy full SHA for b3e991e
README.md
@@ -66,6 +66,6 @@ function typeOfExpression() {};
66
* My addition, OmitFromInterface<T, U> is like Omit except it omits the *properties* of the second type, so U is an interface as well.
67
*/
68
type Diff<T extends string, U extends string> = ({[P in T]: P } & {[P in U]: never } & { [x: string]: never })[T];
69
-type Omit<T, K extends keyof T> = {[P in Diff<keyof T, K>]: T[P]};
+type Omit<T, K extends keyof T> = Pick<T, Diff<keyof T, K>>;
70
type OmitInterface<T, U> = Omit<T, keyof U>;
71
```
0 commit comments