What version of protobuf and what language are you using?
Version: google-protobuf 3.17.3 and @types/google-protobuf 3.15.3
Language: JavaScript / Typescript
What did you do?
Steps to reproduce the behavior:
Use type map in a protobuf message
Compile the proto file to JavaScript
In a Typescript environment, try to access the map's value iterator that is part of the generated JavaScript code.
What did you expect to see
Methods keys() and values() that return a key and a value iterator:
Anything else we should know about your project / environment
As a workaround, you can cast to any first. Let's assume, you want to get an array of values from the map. Then
What version of protobuf and what language are you using? Version: google-protobuf 3.17.3 and @types/google-protobuf 3.15.3 Language: JavaScript / Typescript
What did you do? Steps to reproduce the behavior:
map
in a protobuf messageWhat did you expect to see Methods
keys()
andvalues()
that return a key and a value iterator:What did you see instead? In
@types/google-protobuf
in fileindex.js
I can find the key iterator only, the value iterator is missing:Anything else we should know about your project / environment As a workaround, you can cast to any first. Let's assume, you want to get an array of values from the map. Then
will fail, because method
values()
is unknown to the Typescript compiler. Butwill work, since the method
values()
is available in the generated Javascript code.