Skip to content

Commit

Permalink
[Fix] make isBuffer check slightly more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Mar 7, 2020
1 parent 1c3cc25 commit c21e14d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ function isBuffer(x) {
if (x.length > 0 && typeof x[0] !== 'number') {
return false;
}
return true;

return !!(x.constructor && x.constructor.isBuffer && x.constructor.isBuffer(x));
}

function setEquiv(a, b, opts, channel) {
Expand Down

0 comments on commit c21e14d

Please sign in to comment.