Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

toBuffer() docs wrong? #88

Open
mprobst opened this issue Feb 27, 2018 · 3 comments
Open

toBuffer() docs wrong? #88

mprobst opened this issue Feb 27, 2018 · 3 comments

Comments

@mprobst
Copy link

mprobst commented Feb 27, 2018

toBuffer() is documented as returning ArrayBuffer, but returns Buffer in nodejs in practice.

https://github.com/dcodeIO/bytebuffer.js/wiki/API#bytebuffertobufferforcecopy

Oversight, intentional?

@dcodeIO
Copy link
Member

dcodeIO commented Feb 27, 2018

Iirc the docs have been generated from the browser version, where it's all ArrayBuffer.

@mprobst
Copy link
Author

mprobst commented Feb 27, 2018 via email

@dcodeIO
Copy link
Member

dcodeIO commented Feb 27, 2018

As a workaround, you could try to wrap the result of toBuffer() in a Buffer.from(...).

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

No branches or pull requests

2 participants