Skip to content

Commit

Permalink
Use is-buffer module instead of Buffer.isBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
deathcap committed Feb 8, 2016
1 parent 243b86b commit 3fd85fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mf-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ const Writable = require('stream').Writable;
const through = require('through');
const ndarray = require('ndarray');
const vec3Object = require('vec3'); // note: object type used by mineflayer, NOT gl-vec3 which is just a typed array :(
const isBuffer = require('is-buffer');

module.exports = function(self) {
console.log('mf-worker initializing',self);

self.readStream = ParentStream().pipe(toBufferStream).pipe(through(function write(event) {
if (Buffer.isBuffer(event)) {
if (isBuffer(event)) {
// buffer data passes through to readStream -> duplexStream for bot
this.queue(event);
} else {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"dependencies": {
"duplexer": "^0.1.1",
"ever": "0.0.3",
"is-buffer": "^1.1.2",
"itempile": "^1.0.2",
"minecraft-data": "^0.19.1",
"ndarray": "^1.0.14",
Expand Down

0 comments on commit 3fd85fc

Please sign in to comment.