Repository navigation
Conversation
there is no need to check the entity type because `Buffer.byteLength` works correctly for both `String` and `Buffer` `utf8` is the default encoding when entity is a `String` this change also make the module compatible with `TypedArray` entities see: https://nodejs.org/api/buffer.html#static-method-bufferbytelengthstring-encoding
UlisesGascon
left a comment
There was a problem hiding this comment.
Thanks @pirxpilot for creating this PR! :)
Currently we support Node.js super legacy versions, like Node@0.8 and this refactor might not work for that versions (ref) buffer support was added "recently".
But this change can work 💯 for the next major 👍
|
Thanks. Makes sense. |
|
Thank you for the PR and sorry it's taken a couple of years to prepare the next major. This has been accomplished in #65 and #69. The latter will support any |
there is no need to check the entity type because
Buffer.byteLengthworks correctly for bothStringandBufferutf8is the default encoding when entity is aStringthis change also make the module compatible with
TypedArrayentitiessee:
https://nodejs.org/api/buffer.html#static-method-bufferbytelengthstring-encoding