-
Notifications
You must be signed in to change notification settings - Fork 48
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
MessagePack Proposal v5 with explicit string type. #8
Conversation
Reference: https://gist.github.com/frsyuki/5432559#types-extension-type * Reorder decoder types detection code so it aligns with mapping tables in the specs. * Changed how `undefined` are handled, uses the `fixext 1` extension type instead. * Removed old `raw`-related things. * Added support for `str` type family decoded to node string. * Added support for `bin` type family decoded to node Buffer. * Added support for `ext` and `fixext` type family decoded to a [type, Buffer] tuple. * Exception for `fixext 1` which is just 1-byte long so a simple [type, value] is returned instead. * TODO: There is no test for the `ext` and `fixext` since there is no way/need in JS to specify and encode "extension" type. Would be good to have tests on decoding part though since other languages/implementation may have made use of them.
Official spec: https://github.com/msgpack/msgpack/blob/master/spec.md |
Could this help #15? |
👍 |
Wow, I've almost forgotten this PR, it has been so long. Also buried under a pile of other GH notifications. I'll try to get this mergeable tonight, hopefully. |
@chakrit cool 😄 |
@creationix @nkzawa I've merged master back into my fork and gotten rid of the only README conflict.
|
MessagePack Proposal v5 with explicit string type.
Reference: https://gist.github.com/frsyuki/5432559#types-extension-type
GH Issue: #7
undefined
are handled, uses thefixext 1
extension type instead.raw
-related things.str
type family decoded to node string.bin
type family decoded to node Buffer.ext
andfixext
type family decoded to a [type, Buffer] tuple.fixext 1
which is just 1-byte long so a simple [type, value] isreturned instead.
ext
andfixext
since there is no way/need in JS tospecify and encode "extension" type. Would be good to have tests on decoding part though
since other languages/implementation may have made use of them.