Skip to content

Maps with 'value class' keys that have primitive values should be converted to indexed types #28

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

Closed
aSemy opened this issue Apr 10, 2022 · 0 comments · Fixed by #29
Closed
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@aSemy
Copy link
Contributor

aSemy commented Apr 10, 2022

PrototypeKey is a primitive, so it's a valid value for an indexed type key.

export interface Dictionary {
  protos: Map<PrototypeKey, PrototypeName>; // actual
  protos: { [key: PrototypeKey]: { [key: string]: PrototypeKey } }; // expected
}

export type PrototypeKey = string;
@aSemy aSemy added bug Something isn't working enhancement New feature or request labels Apr 10, 2022
@aSemy aSemy self-assigned this Apr 10, 2022
@aSemy aSemy linked a pull request Apr 10, 2022 that will close this issue
@aSemy aSemy closed this as completed in #29 Apr 10, 2022
aSemy added a commit that referenced this issue Apr 10, 2022
* #28 allow value classes as indexed type map keys

* more tests for type alias enum map keys

* tidy up inline type extractor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant