Skip to content

Commit

Permalink
Don't use unreliable Node detection
Browse files Browse the repository at this point in the history
  • Loading branch information
mbloch committed Nov 25, 2016
1 parent 87b9c62 commit 480f2f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mbloch-utils.js
Expand Up @@ -1004,7 +1004,7 @@ Utils.mean = function(arr) {
function BinArray(buf, le) {
if (Utils.isNumber(buf)) {
buf = new ArrayBuffer(buf);
} else if (Env.inNode && buf instanceof Buffer == true) {
} else if (typeof Buffer == 'function' && buf instanceof Buffer) {
// Since node 0.10, DataView constructor doesn't accept Buffers,
// so need to copy Buffer to ArrayBuffer
buf = BinArray.toArrayBuffer(buf);
Expand Down

0 comments on commit 480f2f2

Please sign in to comment.