-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
feat(*): add OmitKeyof
to Omit object by object's keys strictly
#7139
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 155859b. 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 targetSent 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 155859b:
|
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.
I left my intention
UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, | ||
'placeholderData' | 'suspense' |
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.
This unnecessary suspense field could be removed by OmitKeyof
with correct type error
OmitKeyof
to Omitting keys strictly
OmitKeyof
to Omitting keys strictlyOmitKeyof
to Omit keys strictly
OmitKeyof
to Omit keys strictlyOmitKeyof
to Omit object by object's keys strictly
# Overview <!-- A clear and concise description of what this pr is about. --> related with TanStack/query#7139 This change update `OmitKeyof` to validate Omitting keys should be keyof Omitted Object Type As shown below, the inconvenience of having to manually remove unnecessary fields can be identified early on at the type level with `OmitKeyof`. ### Motivatings - https://github.com/TanStack/query/pull/6907/files - TanStack/query#7139 (comment) ### Expectation I made test-d to type-test `OmitKeyof` - For complex types using `Omit`, I want to reduce the difficulty of library maintenance for it. - `OmitKeyof` provide autocomplete by extending keyof TObject  - `OmitKeyof` check strictly second type parameter of it by extending keyof TObject  - `OmitKeyof` prevent library contributors make misspell like queryTey or qeuryKey  - Library users can be supplied with stable types consistently ## 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 <!-- A clear and concise description of what this pr is about. --> related with TanStack/query#7139 This change update `OmitKeyof` to validate Omitting keys should be keyof Omitted Object Type As shown below, the inconvenience of having to manually remove unnecessary fields can be identified early on at the type level with `OmitKeyof`. ### Motivatings - https://github.com/TanStack/query/pull/6907/files - TanStack/query#7139 (comment) ### Expectation I made test-d to type-test `OmitKeyof` - For complex types using `Omit`, I want to reduce the difficulty of library maintenance for it. - `OmitKeyof` provide autocomplete by extending keyof TObject  - `OmitKeyof` check strictly second type parameter of it by extending keyof TObject  - `OmitKeyof` prevent library contributors make misspell like queryTey or qeuryKey  - Library users can be supplied with stable types consistently ## 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 <!-- A clear and concise description of what this pr is about. --> related with TanStack/query#7139 This change update `OmitKeyof` to validate Omitting keys should be keyof Omitted Object Type As shown below, the inconvenience of having to manually remove unnecessary fields can be identified early on at the type level with `OmitKeyof`. ### Motivatings - https://github.com/TanStack/query/pull/6907/files - TanStack/query#7139 (comment) ### Expectation I made test-d to type-test `OmitKeyof` - For complex types using `Omit`, I want to reduce the difficulty of library maintenance for it. - `OmitKeyof` provide autocomplete by extending keyof TObject  - `OmitKeyof` check strictly second type parameter of it by extending keyof TObject  - `OmitKeyof` prevent library contributors make misspell like queryTey or qeuryKey  - Library users can be supplied with stable types consistently ## 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 <!-- A clear and concise description of what this pr is about. --> related with TanStack/query#7139 This change update `OmitKeyof` to validate Omitting keys should be keyof Omitted Object Type As shown below, the inconvenience of having to manually remove unnecessary fields can be identified early on at the type level with `OmitKeyof`. ### Motivatings - https://github.com/TanStack/query/pull/6907/files - TanStack/query#7139 (comment) ### Expectation I made test-d to type-test `OmitKeyof` - For complex types using `Omit`, I want to reduce the difficulty of library maintenance for it. - `OmitKeyof` provide autocomplete by extending keyof TObject  - `OmitKeyof` check strictly second type parameter of it by extending keyof TObject  - `OmitKeyof` prevent library contributors make misspell like queryTey or qeuryKey  - Library users can be supplied with stable types consistently ## 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 <!-- A clear and concise description of what this pr is about. --> related with TanStack/query#7139 This change update `OmitKeyof` to validate Omitting keys should be keyof Omitted Object Type As shown below, the inconvenience of having to manually remove unnecessary fields can be identified early on at the type level with `OmitKeyof`. ### Motivatings - https://github.com/TanStack/query/pull/6907/files - TanStack/query#7139 (comment) ### Expectation I made test-d to type-test `OmitKeyof` - For complex types using `Omit`, I want to reduce the difficulty of library maintenance for it. - `OmitKeyof` provide autocomplete by extending keyof TObject  - `OmitKeyof` check strictly second type parameter of it by extending keyof TObject  - `OmitKeyof` prevent library contributors make misspell like queryTey or qeuryKey  - Library users can be supplied with stable types consistently ## 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.
This change add
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 #7139 (comment)Expectation
I made test-d to type-test
OmitKeyof
in https://github.com/TanStack/query/pull/7139/files#diff-e6421be8af92bef480137fd70c8e935fd1975d73ae3a75f393893de5542e2a41Omit
, 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 qeuryKey