mcollina / msgpack5

A msgpack v5 implementation for node.js, with extension points / msgpack.org[Node]
MIT License
492 stars 76 forks source link

Why is Uint8Array serialized as map? #58

Closed moozzyk closed 6 years ago

moozzyk commented 6 years ago

I am using msgpack5 in a browser and when I try to pack new Uint8Array([1, 2, 3]) I get the following payload 0x83 0xa1 0x30 0x01 0xa1 0x31 0x02 0xa1 0x32 0x03 which is a map. I expected to get a bin8. Looking at the code it appears that binX would work for Buffer but because msgpack5 is wrapped in a library/module the Buffer does not seem to be available outside the library.

mcollina commented 6 years ago

it’s a bug! Would you like to send a PR?

moozzyk commented 6 years ago

Hactoberfest, here I come! (I will try to submit a PR in the coming days).