-
Notifications
You must be signed in to change notification settings - Fork 349
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
Feat: proto map generates a Hashmap instead of an object #547
Comments
I dunno, not 100% against it, but I think the existing output is ~slightly more idiomatic JS/TS where "maps" are, IMO anyways, almost always just objects with keys and not the actual If you want to add an option for it, that seems fine; I'm a little concerned about having two types of Thanks! |
moznion
added a commit
to moznion/ts-proto
that referenced
this issue
Oct 15, 2022
This option controls the way to generate the code for protobuf's `map<key_type, value_type>`: - true: it generates the code with using JavaScript Map type like `Map<key_type, value_type>` - false (default): it generates the code with key-value pair like `{[key: key_type]: value_type}` This fixes stephenh#547 Signed-off-by: moznion <moznion@mail.moznion.net>
stephenh
pushed a commit
that referenced
this issue
Oct 16, 2022
This option controls the way to generate the code for protobuf's `map<key_type, value_type>`: - true: it generates the code with using JavaScript Map type like `Map<key_type, value_type>` - false (default): it generates the code with key-value pair like `{[key: key_type]: value_type}` This fixes #547 Signed-off-by: moznion <moznion@mail.moznion.net> Signed-off-by: moznion <moznion@mail.moznion.net>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
currently,
map<uint32, X> x = 2;
in proto outputs{ [key: number]: X }
.What are your thoughts of it generating a HashMap instead?
The text was updated successfully, but these errors were encountered: