Properly emit close events for duplex streams (#2976)

This commit is contained in:
Drian Naude
2021-11-18 00:19:58 +13:00
committed by GitHub
parent 602f988aba
commit a06b8c296a
2 changed files with 17 additions and 0 deletions

View File

@@ -1078,6 +1078,7 @@ function _pipeline (callback) {
this.push(data);
}
this.push(null);
this.emit('close');
});
});
if (this.streamInFinished) {
@@ -1093,6 +1094,7 @@ function _pipeline (callback) {
this.push(data);
}
this.push(null);
this.emit('close');
});
}
return this;