memorystream
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -51,2 +51,3 @@ 'use strict'; | ||
}); | ||
} | ||
@@ -108,3 +109,2 @@ | ||
wait_data = this instanceof STREAM.Duplex && ! this._writableState.finished ? true : false; | ||
if ( ! this.queue.length && ! wait_data) { | ||
@@ -149,2 +149,5 @@ this.push(null);// finish stream | ||
if (this instanceof STREAM.Duplex) { | ||
while (this.queue.length) { | ||
this.push(this.queue.shift()); | ||
} | ||
this.push(decoded_chunk); | ||
@@ -151,0 +154,0 @@ } else { |
{ | ||
"name": "memorystream", | ||
"description": "This is lightweight memory stream module for node.js.", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "memory", |
@@ -279,2 +279,25 @@ var MemoryStream = require('../index.js'), | ||
}); | ||
it("should write/read data with init buffer", function (done) { | ||
var l = Math.floor(test_data.length / 2); | ||
var test_data1 = test_data.substr(0, l), | ||
test_data2 = test_data.substr(l); | ||
var mem_stream = new MemoryStream(test_data1.split('')); | ||
var data = ''; | ||
mem_stream.on('data',function(chunk){ | ||
data += chunk; | ||
}); | ||
writeToStream2(mem_stream, test_data2); | ||
mem_stream.on('end', function() { | ||
expect(data).to.be(test_data); | ||
done(); | ||
}); | ||
}); | ||
@@ -281,0 +304,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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
23175
458
1
8