ordered-read-streams
Advanced tools
Comparing version 1.0.0 to 1.0.1
36
index.js
var Readable = require('readable-stream/readable'); | ||
var isReadable = require('is-stream').readable; | ||
var util = require('util'); | ||
function isReadable(stream) { | ||
if (typeof stream.pipe !== 'function') { | ||
return false; | ||
} | ||
if (!stream.readable) { | ||
return false; | ||
} | ||
if (typeof stream._read !== 'function') { | ||
return false; | ||
} | ||
if (!stream._readableState) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
function addStream (streams, stream) { | ||
@@ -16,11 +35,10 @@ if (!isReadable(stream)) { | ||
var chunk = stream.read(); | ||
if (chunk === null) { | ||
return; | ||
while (chunk) { | ||
if (this === streams[0]) { | ||
self.push(chunk); | ||
} else { | ||
this._buffer.push(chunk); | ||
} | ||
chunk = stream.read(); | ||
} | ||
if (this === streams[0]) { | ||
self.push(chunk); | ||
} else { | ||
this._buffer.push(chunk); | ||
} | ||
}); | ||
@@ -27,0 +45,0 @@ |
{ | ||
"name": "ordered-read-streams", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Combines array of streams into one read stream in strict order", | ||
@@ -15,13 +15,13 @@ "files": [ | ||
"dependencies": { | ||
"is-stream": "^1.0.1", | ||
"readable-stream": "^2.0.1" | ||
}, | ||
"devDependencies": { | ||
"expect": "^1.20.2", | ||
"jscs": "^1.13.1", | ||
"jshint": "^2.8.0", | ||
"mississippi": "^1.3.0", | ||
"mocha": "^2.2.5", | ||
"pre-commit": "^1.0.10", | ||
"should": "^7.0.1", | ||
"through2": "^2.0.0" | ||
} | ||
} |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
5081
1
76
7
1
- Removedis-stream@^1.0.1
- Removedis-stream@1.1.0(transitive)