-
-
Notifications
You must be signed in to change notification settings - Fork 292
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
Types is incorrect after omitting keys #2134
Comments
microsoft/TypeScript#36981 Looks like a larger problem |
Seems that this issue has been rescheduled. The related PR resolve the problem by writing |
@jdalrymple Sorry for the ping, but probably it won't be fixed any time soon. As a workaround, I suggest using a utility type instead of I prepared an example with
Direct usage of
However, for
In another example I replaced
|
Good find! I keep this in mind to make the tweak when i have a moment! |
@jdalrymple Is it fixed? I still see |
Now that i review this, it looks like i didn't fully solve this previously. I will now though! Should have it back up in an hour or so |
I see that you are in Montreal, I should definitely buy you a beer someday |
Gonna try this type: microsoft/TypeScript#54451, looks alot stricter than Omit, tell me if you run into any problems once i deploy! |
🚀 Issue was released in |
Description
After omitting some fields from existing Schema types, the types of remained fields become
unknown
.Steps to reproduce
Expected behaviour
The type of
branch.commit.id
should bestring
.Actual behaviour
The type of
branch.commit.id
isunknown
.Possible fixes
All Schema types extend from
Record<string, unknown>
. For example:While the other is not extended from
Record
type:Because
Omit
is implemented byExclude
, so the excluded keys is incorrect if the object type extends fromRecord
type.The text was updated successfully, but these errors were encountered: