bytebuffer.js
bytebuffer.js copied to clipboard
toBuffer() docs wrong?
toBuffer()
is documented as returning ArrayBuffer
, but returns Buffer
in nodejs in practice.
https://github.com/dcodeIO/bytebuffer.js/wiki/API#bytebuffertobufferforcecopy
Oversight, intentional?
Iirc the docs have been generated from the browser version, where it's all ArrayBuffer.
I ran into this because the TypeScript .d.ts has toBuffer return ArrayBuffer in node, which then causes incorrect compilation errors. Any ideas on how to avoid that?
Daniel Wirtz [email protected] schrieb am Di., 27. Feb. 2018 um 17:58 Uhr:
Iirc the docs have been generated from the browser version, where it's all ArrayBuffer.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dcodeIO/bytebuffer.js/issues/88#issuecomment-368948576, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAcKHl8bReFL9RB58DlibPwox08N5J6ks5tZDQ1gaJpZM4SVPg9 .
As a workaround, you could try to wrap the result of toBuffer()
in a Buffer.from(...)
.