Skip to content

Commit

Permalink
[minor] Fix nit
Browse files Browse the repository at this point in the history
  • Loading branch information
lpinca committed Dec 13, 2022
1 parent e6a32f8 commit 1b057f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/buffer-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ function _unmask(buffer, mask) {
* @public
*/
function toArrayBuffer(buf) {
if (buf.byteLength === buf.buffer.byteLength) {
if (buf.length === buf.buffer.byteLength) {
return buf.buffer;
}

return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.length);
}

/**
Expand Down

0 comments on commit 1b057f9

Please sign in to comment.