-
Notifications
You must be signed in to change notification settings - Fork 25
Closed
Description
In order to be performant in certain usecases, we need to be able to force generated code to use number instead of bigint.
Protons should be extended to support a field option named jstype used like so:
message Foo {
uint64 bar = 1 [jstype = JS_NUMBER];
}import { Foo } from './foo.js'
const foo = {
bar: 100 // a number :)
}
typeof Foo.decode(Foo.encode(foo)).bar === 'number'See
- https://protobuf.dev/programming-guides/proto3/#customoptions
- https://protobuf.dev/programming-guides/proto2/#options
- https://github.com/protocolbuffers/protobuf/blob/f881c8fe15b8c9aa3be997103eee5f2bea02984d/src/google/protobuf/descriptor.proto#L620-L641
- feat!: switch back to protons ChainSafe/js-libp2p-gossipsub#327 (comment)
twoeths and nazarhussain
Metadata
Metadata
Assignees
Labels
No labels