Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Omit with Pick + Exclude #899

Merged

Conversation

newyankeecodeshop
Copy link
Contributor

Recently the type declarations include the use of the Omit library type. This type was added in TypeScript 3.5 (https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type), and therefore the change prevents using this library with TypeScript projects that have not upgraded. (In my case, we use TypeScript 3.4.)

I replaced the use of Omit with the same implementation based on Pick and Exclude:
type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;

I'm not sure what the minimum TypeScript this project supports, but this will at least prevent issues with some earlier 3.x versions.

@osdnk osdnk merged commit 4673c67 into software-mansion:master Jan 2, 2020
@newyankeecodeshop newyankeecodeshop deleted the support-older-typescript branch January 2, 2020 18:32
janicduplessis pushed a commit to janicduplessis/react-native-gesture-handler that referenced this pull request Feb 16, 2020
Recently the type declarations include the use of the Omit library type. This type was added in TypeScript 3.5 (typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type), and therefore the change prevents using this library with TypeScript projects that have not upgraded. (In my case, we use TypeScript 3.4.)

I replaced the use of Omit with the same implementation based on Pick and Exclude:
type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;

I'm not sure what the minimum TypeScript this project supports, but this will at least prevent issues with some earlier 3.x versions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants