ts-proto icon indicating copy to clipboard operation
ts-proto copied to clipboard

Feat: proto map generates a Hashmap instead of an object

Open jay-babu opened this issue 3 years ago • 1 comments

currently,

map<uint32, X> x = 2; in proto outputs { [key: number]: X }.

What are your thoughts of it generating a HashMap instead?

jay-babu avatar Apr 08 '22 01:04 jay-babu

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!

stephenh avatar Apr 08 '22 02:04 stephenh

This was just fixed in #686 and will be in a release soon; thanks @moznion !

stephenh avatar Oct 16 '22 15:10 stephenh