-
-
Notifications
You must be signed in to change notification settings - Fork 515
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
Transpose or invert object keys to/from key-like literal values #543
Comments
What are some practical use-cases for this? I don't really see the use-case without also an actual code implementation, and then you would do so in TS and not need this type. |
It could also be more type-safe by ensuring the input object values are valid keys. |
Fixed in the description.
I don't have 1. It was for an unfortunately contrived teaching exercise. I thought it'd be worthwhile to share the implementation (perhaps closing the issue) and reconsider if someone comes looking (like I did) with a better use case. |
Sounds right so I linked it to the invert function in Remeda instead. |
I'm not sure whether this would be generally useful. I personally struggled to implement it. Happy to PR but wanted to gauge interest first and document my solution for searchability otherwise:
[Playground]
The text was updated successfully, but these errors were encountered: