Skip to content

Commit

Permalink
[fix] Use ArrayBuffer.isView to check for typed arrays (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
darrachequesne committed Feb 25, 2018
1 parent dd164e6 commit 8822578
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion is-buffer.js
Expand Up @@ -9,5 +9,5 @@ module.exports = isBuf;

function isBuf(obj) {
return (global.Buffer && global.Buffer.isBuffer(obj)) ||
(global.ArrayBuffer && obj instanceof ArrayBuffer);
(global.ArrayBuffer && (obj instanceof ArrayBuffer || ArrayBuffer.isView(obj)));
}

0 comments on commit 8822578

Please sign in to comment.