profile
viewpoint

Ask questionsenums don't default to UNRECOGNIZED value like java

To be compatible with newly added enums in proto definitions, the typescript enum deserialization should default to UNRECOGNIZED / -1

https://github.com/stephenh/ts-proto/blob/master/src/main.ts#L321

This is what java generates for enum

public enum ChangeType implements ProtocolMessageEnum {
    ADDED(0),
    REMOVED(1),
    MODIFIED(2),
    UNRECOGNIZED(-1);

Happy to make a contribution if you are ok with the update.

stephenh/ts-proto

Answer questions mscolnick

makes total sense. will put something up within the week. thank you

useful!

Related questions

No questions were found.
Github User Rank List