Open krpecd opened 2 years ago
toObject() for proto3 optional fields are still generated like so by the protoc js compiler:
optionalField: jspb.Message.getFieldWithDefault(msg, 1, ""),
Note the Default
part.
This conforms with the google-protobuf getter APIs and getter semantics in other languages. Please do not change this behavior with toObject().
When a proto file has an optional field:
It generates this TS definitions
I think the namespace should be in this format:
I can find out if the field is in the message by using
hasOptionalField
method. But TS check is not working as expected.