Comparing version 1.1.3 to 1.2.0
23
index.js
var pump = require('pump') | ||
var util = require('util') | ||
var duplexify = require('duplexify') | ||
var Duplexify = require('duplexify') | ||
@@ -14,19 +14,12 @@ var toArray = function(arguments) { | ||
if (!(this instanceof Pumpify)) return new Pumpify(streams) | ||
duplexify.call(this, null, null, opts) | ||
this._onflush = null | ||
this._flushed = false | ||
Duplexify.call(this, null, null, opts) | ||
if (streams.length) this.setPipeline(streams) | ||
} | ||
util.inherits(Pumpify, duplexify) | ||
util.inherits(Pumpify, Duplexify) | ||
Pumpify.prototype._flush = function(cb) { | ||
if (this._flushed) return cb() | ||
this._onflush = cb | ||
} | ||
Pumpify.prototype.setPipeline = function() { | ||
var streams = toArray(arguments) | ||
var self = this | ||
var ended = false | ||
var w = streams[0] | ||
@@ -43,7 +36,11 @@ var r = streams[streams.length-1] | ||
this.on('close', onclose) | ||
this.on('prefinish', function() { | ||
if (!ended) self.cork() | ||
}) | ||
pump(streams, function(err) { | ||
self.removeListener('close', onclose) | ||
if (err) return self.destroy(err) | ||
if (self._onflush) self._onflush() | ||
self._flushed = true | ||
ended = true | ||
self.uncork() | ||
}) | ||
@@ -50,0 +47,0 @@ |
{ | ||
"name": "pumpify", | ||
"version": "1.1.3", | ||
"version": "1.2.0", | ||
"description": "Combine an array of streams into a single duplex stream using pump and duplexify", | ||
"main": "index.js", | ||
"dependencies": { | ||
"duplexify": "^2.0.0", | ||
"duplexify": "^3.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
7041
176
+ Addedcore-util-is@1.0.3(transitive)
+ Addedduplexify@3.7.1(transitive)
+ Addedend-of-stream@1.4.4(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedstream-shift@1.0.3(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
- Removedduplexify@2.0.0(transitive)
Updatedduplexify@^3.0.0