-
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
Convert Longs to strings and ByteBuffers to Buffers #281
Comments
|
Cool, that works. I think the description of that method could be a bit clearer, though. It's not obvious what "raw payload" means. Is there perhaps also a way to remove all the |
Customize your toRaw method
|
Don't do that, use |
I don't understand, they look the same |
@zhiqingchen You are using/looking at an old version of ByteBuffer. This is the latest version of that method: https://github.com/dcodeIO/ByteBuffer.js/blob/master/src/methods/static/isByteBuffer.js See this issue for more info: protobufjs/bytebuffer.js#52 |
@englercj |
Closing this for now. Feel free to send a pull request if this is still a requirement. |
My library passes decoded protobuf messages directly to users. Since I don't want to tie the library to Long.js and ByteBuffer.js, I run all objects through a function that converts any Long objects to strings and any ByteBuffer objects to Buffers. It gets a bit messy when there are nested messages.
Do you think adding options to convert Longs to strings and/or ByteBuffers to Buffers on decode would be a meaningful addition to ProtoBuf.js?
The text was updated successfully, but these errors were encountered: