-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
fix(react): add OmitKeyof safely and test cases for it #816
Conversation
🦋 Changeset detectedLatest commit: 35369e9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #816 +/- ##
=======================================
Coverage 85.34% 85.34%
=======================================
Files 30 30
Lines 505 505
Branches 114 114
=======================================
Hits 431 431
Misses 64 64
Partials 10 10
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delicious.. I love that user can do Strictly Omit without compromising the existing interface!
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @suspensive/react@1.26.6 ### Patch Changes - [#816](#816) [`33fe78c`](33fe78c) Thanks [@manudeli](https://github.com/manudeli)! - fix(react): add OmitKeyof safely and test cases for it ## @suspensive/react-query@1.26.6 ### Patch Changes - Updated dependencies \[[`33fe78c`](33fe78c)]: - @suspensive/react@1.26.6 Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Same with #816 # Overview <!-- A clear and concise description of what this pr is about. --> ## PR Checklist - [x] I did below actions if need 1. I read the [Contributing Guide](https://github.com/suspensive/react/blob/main/CONTRIBUTING.md) 2. I added documents and tests.
Overview
related with TanStack/query#7139
This change update
OmitKeyof
to validate Omitting keys should be keyof Omitted Object TypeAs shown below, the inconvenience of having to manually remove unnecessary fields can be identified early on at the type level with
OmitKeyof
.Motivatings
OmitKeyof
to Omit object by object's keys strictly TanStack/query#7139 (comment)Expectation
I made test-d to type-test
OmitKeyof
Omit
, I want to reduce the difficulty of library maintenance for it.OmitKeyof
provide autocomplete by extending keyof TObjectOmitKeyof
check strictly second type parameter of it by extending keyof TObjectOmitKeyof
prevent library contributors make misspell like queryTey or qeuryKeyPR Checklist