I don't understand what some of the utility types in query-core do. #7710
Unanswered
novice0840
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This is a utility type in file "types" in package "query-core"
I understand that the type has the ability to omit the TKey from TObject, so I'm taking that type and creating a third argument there called TStrictly to control the range that the Tkey value can have based on the value of the argument.
The problem is "Record<never, never>". I understand that this represents an empty object, but I don't understand how "string & Record<never, never>" is different from just "string".
In fact, when I experimented with both types in the Typescript playground, I got the same result: both types allow only strings to be entered.
If I'm misunderstanding something, please let me know.
Beta Was this translation helpful? Give feedback.
All reactions