Skip to content

Commit cde47a7

Browse files
committed
Support being bundled by Browserify 4.2.
1 parent 4c4f287 commit cde47a7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/connection.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,12 @@ Connection.prototype._write = function(data, encoding, done) {
164164

165165
var byte = null, result;
166166

167+
// needed to handle UInt8ArrayViewS in browsers
168+
// https://github.com/mcollina/mows/issues/10
169+
if (!Buffer.isBuffer(data)) {
170+
data = new Buffer(data);
171+
}
172+
167173
this.index = 0;
168174
this.data = data;
169175

0 commit comments

Comments
 (0)