Comparing version 1.1.2 to 1.1.3
19
index.js
@@ -13,6 +13,6 @@ var pump = require('pump') | ||
var streams = toArray(arguments) | ||
if (!(this instanceof Pumpify)) return new Pumpify(streams) | ||
duplexify.call(this, null, null, opts) | ||
this._onflush = null | ||
this._flushed = false | ||
if (streams.length) this.setPipeline(streams) | ||
@@ -23,2 +23,7 @@ } | ||
Pumpify.prototype._flush = function(cb) { | ||
if (this._flushed) return cb() | ||
this._onflush = cb | ||
} | ||
Pumpify.prototype.setPipeline = function() { | ||
@@ -34,7 +39,2 @@ var streams = toArray(arguments) | ||
var onprefinish = function(cb) { | ||
if (r._writableState.ended) return cb() | ||
r.on('finish', cb) | ||
} | ||
var onclose = function() { | ||
@@ -44,7 +44,8 @@ streams[0].emit('error', new Error('stream was destroyed')) | ||
if (r && r._writableState) this.on('prefinish', onprefinish) | ||
this.on('close', onclose) | ||
pump(streams, function(err) { | ||
self.removeListener('close', onclose) | ||
self.destroy(err) | ||
if (err) return self.destroy(err) | ||
if (self._onflush) self._onflush() | ||
self._flushed = true | ||
}) | ||
@@ -51,0 +52,0 @@ |
{ | ||
"name": "pumpify", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "Combine an array of streams into a single duplex stream using pump and duplexify", | ||
"main": "index.js", | ||
"dependencies": { | ||
"duplexify": "^1.5.2", | ||
"duplexify": "^2.0.0", | ||
"pump": "^0.3.3" | ||
@@ -9,0 +9,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
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
7131
178
+ Addedduplexify@2.0.0(transitive)
- Removedduplexify@1.5.3(transitive)
Updatedduplexify@^2.0.0