query
query copied to clipboard
fix(query-core): add `number`, `symbol` as safe key for `OmitKeyof` for strictness `safely`
Motivation
TypeScript original Omit's 2nd type parameter's type should be string | number | symbol.
But Error is occured when we use OmitKeyof with 'safely' for object having number | symbol key
Solution
So I update constraint of OmitKeyof's 2nd type parameter when using 'safely' like original Omit's one
export type OmitKeyof<
TObject,
TKey extends TStrictly extends 'safely'
?
| keyof TObject
| (string & Record<never, never>)
+ | (number & Record<never, never>)
+ | (symbol & Record<never, never>)
: keyof TObject,
TStrictly extends 'strictly' | 'safely' = 'strictly',
> = Omit<TObject, TKey>
Expectation
No error when we use OmitKeyof with 'safely' for object having number | symbol key
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| query | ⬜️ Ignored (Inspect) | Visit Preview | May 6, 2024 6:19am |
☁️ Nx Cloud Report
CI is running/has finished running commands for commit 7bc46bd2a70213f6665b95da9ee7e02c5acc9802. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.
📂 See all runs for this CI Pipeline Execution
✅ Successfully ran 1 target
Sent with 💌 from NxCloud.
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit 7bc46bd2a70213f6665b95da9ee7e02c5acc9802:
| Sandbox | Source |
|---|---|
| @tanstack/query-example-angular-basic | Configuration |
| @tanstack/query-example-react-basic-typescript | Configuration |
| @tanstack/query-example-solid-basic-typescript | Configuration |
| @tanstack/query-example-svelte-basic | Configuration |
| @tanstack/query-example-vue-basic | Configuration |
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 41.15%. Comparing base (
93674fe) to head (0e5199d). Report is 115 commits behind head on main.
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@ Coverage Diff @@
## main #7164 +/- ##
==========================================
- Coverage 41.42% 41.15% -0.28%
==========================================
Files 184 182 -2
Lines 7331 7404 +73
Branches 1531 1553 +22
==========================================
+ Hits 3037 3047 +10
- Misses 3889 3945 +56
- Partials 405 412 +7
@TkDodo @tannerlinsley, In my opinion this is quite simple Pull Request, review this please