* @param {Object!} jspbObject Enum generated by go/jspb. This is a JavaScript * plain object containing a string-to-number mapping of the enum.
(jspbObject)
| 41 | * plain object containing a string-to-number mapping of the enum. |
| 42 | */ |
| 43 | constructor(jspbObject) { |
| 44 | const entries = Object.entries(jspbObject); |
| 45 | this.numberByName = new Map(entries); |
| 46 | this.nameByNumber = |
| 47 | new Map(entries.map(([name, number]) => [number, name])); |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | const CODE = new ProtobufEnum(ValidationError.Code); |