Skip to content

Commit

Permalink
Allow Omit to distribute over unions (resolves #29)
Browse files Browse the repository at this point in the history
  • Loading branch information
pelotom committed Aug 22, 2018
1 parent eab1903 commit 47e52e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* @see https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-377567046
*/
export type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;
export type Omit<T, K extends keyof any> = T extends any ? Pick<T, Exclude<keyof T, K>> : never;

/**
* Like `T & U`, but where there are overlapping properties using the
Expand Down

0 comments on commit 47e52e0

Please sign in to comment.