Skip to content
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

Support for MapKeys #44

Closed
haejunejung opened this issue Aug 25, 2024 · 0 comments · Fixed by #58
Closed

Support for MapKeys #44

haejunejung opened this issue Aug 25, 2024 · 0 comments · Fixed by #58

Comments

@haejunejung
Copy link
Owner

haejunejung commented Aug 25, 2024

It provides support for MapKeys.

Map is a key-value data structure commonly used for its efficiency, such as in hash maps. The MapKeys type is useful when you need to work with just the keys of a Map, allowing you to extract and use the key type independently from the value type.

type T0 = Map<string, string>;
type Expected = MapKeys<T0> // string

type T1 = Map<'0' | '1' | '2', string>;
type Expected = MapKeys<T1> // '0' | '1' | '2'

Here is a detailed implementation. playground

This was referenced Aug 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant