protobuf-ts
protobuf-ts copied to clipboard
Replace "kind" string literals in field information with enum
From #15:
export enum FieldKind {
SCALAR, MAP, ENUM, MESSAGE
}
The generated field information could use the same pseudo-inlined code [as RepeatType, etc.]:
kind: 1 /*FieldKind.SCALAR*/
This would save quite some bytes in the generated code. It would add some bytes to the runtime, because string literals "scalar" would need to be replaced with FieldKind.SCALAR. But maybe there are some ways around it.