-
-
Notifications
You must be signed in to change notification settings - Fork 506
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
Add a ReadonlyKeys
which finds readonly keys
#211
Labels
Comments
I did one minor addition when I used this in some code now: I wrapped the result in export type WritableKeysOf<T> = NonNullable<{
[P in keyof T]: IfEquals<
{ [Q in P]: T[P] },
{ -readonly [Q in P]: T[P] },
P,
never
>
}[keyof T]>; |
👍 PR welcome. |
Closed
kkmuffme
added a commit
to kkmuffme/type-fest
that referenced
this issue
May 15, 2023
sindresorhus#211 + sindresorhus#616 + opposite since it's very similar and might be useful
kkmuffme
added a commit
to kkmuffme/type-fest
that referenced
this issue
May 15, 2023
Close sindresorhus#211 Close sindresorhus#616 + opposite since it's very similar and might be useful
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I needed to find out what keys that are assignable and remove all keys but those, but found no way in
type-fest
or stocktypescript
, but did stumble upon this trick from @mattmccutchen on Stack Overflow.Making an issue here to keep track of this, if I get time later then I may wrap up a PR, else feel free to make one for this.
The example from Stack Overflow is:
The text was updated successfully, but these errors were encountered: