Skip to content

Commit

Permalink
Fix Buffer instance check in Tap#setData
Browse files Browse the repository at this point in the history
This should now work if Buffer is not defined
  • Loading branch information
valadaptive committed Mar 30, 2024
1 parent 6870ee6 commit 6f39bde
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ class Tap {
}

setData (buf, pos) {
if (buf instanceof Buffer) {
if (typeof Buffer === 'function' && buf instanceof Buffer) {
buf = new Uint8Array(buf.buffer, buf.byteOffset, buf.length);
}
this.arr = buf;
Expand Down

0 comments on commit 6f39bde

Please sign in to comment.