stream-browserify
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "stream-browserify", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "the stream module from node core for browsers", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -28,12 +28,14 @@ var path = require('path'); | ||
test('.writable writing ArrayBuffer', function(t) { | ||
var writable = new TestWritable(); | ||
writable.write(typedArray.buffer); | ||
writable.end(); | ||
t.equal(writable._written.length, 1); | ||
t.equal(writable._written[0].toString(), 'X') | ||
t.end() | ||
}); | ||
if (typeof Uint8array !== 'undefined') { | ||
test('.writable writing ArrayBuffer', function(t) { | ||
var writable = new TestWritable(); | ||
writable.write(typedArray.buffer); | ||
writable.end(); | ||
t.equal(writable._written.length, 1); | ||
t.equal(writable._written[0].toString(), 'X') | ||
t.end() | ||
}); | ||
} | ||
@@ -40,0 +42,0 @@ test('.writable writing Uint8array', function(t) { |
@@ -31,7 +31,11 @@ // Copyright Joyent, Inc. and other Node contributors. | ||
? function (x) { return x instanceof Uint8Array } | ||
: function () { return false } | ||
: function (x) { | ||
return x && x.constructor && x.constructor.name === 'Uint8Array' | ||
} | ||
; | ||
var isArrayBuffer = typeof ArrayBuffer !== 'undefined' | ||
? function (x) { return x instanceof ArrayBuffer } | ||
: function () { return false } | ||
: function () { | ||
return x && x.constructor && x.constructor.name === 'ArrayBuffer' | ||
} | ||
; | ||
@@ -182,3 +186,3 @@ | ||
chunk = new Buffer(chunk); | ||
if (isArrayBuffer(chunk)) | ||
if (isArrayBuffer(chunk) && typeof Uint8Array !== 'undefined') | ||
chunk = new Buffer(new Uint8Array(chunk)); | ||
@@ -185,0 +189,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55849
1503
28