Skip to content
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

decode Array and Uint8Array #28

Closed
kawanet opened this issue Feb 26, 2016 · 2 comments
Closed

decode Array and Uint8Array #28

kawanet opened this issue Feb 26, 2016 · 2 comments

Comments

@kawanet
Copy link
Owner

kawanet commented Feb 26, 2016

The current version of msgpack.decode() accepts only Buffer instance as node.js supports Buffer. On browser environment, it'd be useful when msgpack.decode() accepts plain old Array and Uint8Array as well as Buffer.

See also:

@kawanet
Copy link
Owner Author

kawanet commented Feb 26, 2016

I found that README has mentioned Uint8Array for browser usage. I've added Array and Uint8Array support, then.

// decode() also accepts Array instance
msgpack.decode([0x81, 0xA3, 0x66, 0x6F, 0x6F, 0xA3, 0x62, 0x61, 0x72]);

// decode() accepts raw Uint8Array instance as well
msgpack.decode(new Uint8Array([0x81, 0xA3, 0x66, 0x6F, 0x6F, 0xA3, 0x62, 0x61, 0x72]));

@kawanet kawanet closed this as completed Feb 26, 2016
@pharring
Copy link

Excellent! Thanks for the fast turn-around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants