ordered-read-streams
Advanced tools
Comparing version 0.0.5 to 0.0.6
18
index.js
@@ -24,3 +24,2 @@ var Readable = require('stream').Readable; | ||
this._buff = {}; | ||
this._buffChinks = 0; | ||
this._totalStreams = streams.length; | ||
@@ -42,3 +41,2 @@ this._openedStreams = streams.length; | ||
} else { | ||
self._buffChinks++; | ||
self._buff[i].push(data); // store in buffer for future | ||
@@ -53,8 +51,9 @@ } | ||
if (!--self._openedStreams) { | ||
for (var i = self._currentIndex; i < self._totalStreams; i++) { | ||
while (self._buff[i].length) { | ||
self.push(self._buff[i].shift()); | ||
// flush buffered data (if any) before end | ||
for (var j = 0; j < self._totalStreams; j++) { | ||
while (self._buff[j].length) { | ||
self.push(self._buff[j].shift()); | ||
} | ||
} | ||
self.push(null) | ||
self.push(null); | ||
} | ||
@@ -74,9 +73,4 @@ }); | ||
OrderedStreams.prototype._read = function () { | ||
var data = this._buff[this._currentIndex]; | ||
if (data.length) { | ||
this.push(data); | ||
} | ||
}; | ||
OrderedStreams.prototype._read = function () {}; | ||
module.exports = OrderedStreams; |
{ | ||
"name": "ordered-read-streams", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "Combines array of streams into one read stream in strict order", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
8829
202