We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 197f4b7 commit 2a74b46Copy full SHA for 2a74b46
index.js
@@ -31,6 +31,8 @@ var end = function(ws, fn) {
31
fn()
32
}
33
34
+var noop = function() {}
35
+
36
var toStreams2 = function(rs) {
37
return new (stream.Readable)({objectMode:true, highWaterMark:16}).wrap(rs)
38
@@ -173,13 +175,15 @@ Duplexify.prototype._forward = function() {
173
175
this._forwarding = false
174
176
177
-Duplexify.prototype.destroy = function(err) {
- if (this.destroyed) return
178
+Duplexify.prototype.destroy = function(err, cb) {
179
+ if (!cb) cb = noop
180
+ if (this.destroyed) return cb(null)
181
this.destroyed = true
182
183
var self = this
184
process.nextTick(function() {
185
self._destroy(err)
186
+ cb(null)
187
})
188
189
0 commit comments