ts-proto
ts-proto copied to clipboard
Feat: proto map generates a Hashmap instead of an object
currently,
map<uint32, X> x = 2; in proto outputs { [key: number]: X }.
What are your thoughts of it generating a HashMap instead?
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 Map instances.
If you want to add an option for it, that seems fine; I'm a little concerned about having two types of map output being a little tedious in the code, but I'd merge a PR if you put one together.
Thanks!
This was just fixed in #686 and will be in a release soon; thanks @moznion !