Permalink
Browse files

Fall back to browser Reader when passing an Uint8Array under node, fixes

  • Loading branch information...
dcodeIO committed Jan 2, 2017
1 parent a4e41b5 commit 0c03f327115d57c4cd5eea3a9a1fad672ed6bd44
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/reader.js
@@ -51,7 +51,9 @@ Reader.create = util.Buffer
if (!BufferReader)
BufferReader = require("./reader_buffer");
return (Reader.create = function create_buffer(buffer) {
return new BufferReader(buffer);
return util.Buffer.isBuffer(buffer)
? new BufferReader(buffer)
: new Reader(buffer);
})(buffer);
}
/* istanbul ignore next */

0 comments on commit 0c03f32

Please sign in to comment.