-
Notifications
You must be signed in to change notification settings - Fork 10
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
Proposal: ValueOf -- gets the types of values in a hash. #36
Comments
Are you talking about this? type ValueOf<T> = T[keyof T]; That seems too simple to be worth including. |
It seems like it, but it's not that obvious a construct -- I went looking for it :P |
There's value in naming constructs like this even if they're simple: the name captures the intent, which may not otherwise be obvious to future readers (especially if the semantics of the language change subtly). |
Not to bike shed on the naming, but maybe we should call it ValuesOf since what it's making is a type that combines any value in the hash? |
Ok, well if it’s of value to you I’m happy to add it, PR welcome! |
Prior Art: https://stackoverflow.com/questions/49285864/is-there-a-valueof-similar-to-keyof-in-typescript
The text was updated successfully, but these errors were encountered: