-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Anyway to force deocde fixed64/uint64 as string ? #591
Comments
Note that you could also just compare any Long object using |
Of course long.js is useful. But actually, Say I have a service that get some message from a grpc service, and return a json to browser. Especially at some cases when protobuf message need to convert to JSON, and transport to browser... |
You know that there is The reason why longs aren't just strings by default is that every conversion from bits to strings and vice-versa has a cost, and you really don't want this to happen implicitly all the time. |
Thanks, Sorry for that I really don't know this before, maybe it's because never find this function in generated static js files. Maybe consider to include |
There is no asJSON/from for static code, yet. Related: #588 |
Closing this for now as 6.4.0, which is now released, should solve the issue. Feel free to reopen the issue if necessary. |
Notice that now it's decoded as
long
Object.Anyway to force it to be as
string
?Sometimes
string
is more useful.For example, when a
uint64
is used as id,string
is more convenient to compare and use.The text was updated successfully, but these errors were encountered: