Skip to content

Commit 8822578

Browse files
authoredFeb 25, 2018
[fix] Use ArrayBuffer.isView to check for typed arrays (#82)
1 parent dd164e6 commit 8822578

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎is-buffer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ module.exports = isBuf;
99

1010
function isBuf(obj) {
1111
return (global.Buffer && global.Buffer.isBuffer(obj)) ||
12-
(global.ArrayBuffer && obj instanceof ArrayBuffer);
12+
(global.ArrayBuffer && (obj instanceof ArrayBuffer || ArrayBuffer.isView(obj)));
1313
}

0 commit comments

Comments
 (0)
Please sign in to comment.