Ensure close event occurs after end event #3313

This commit is contained in:
Lovell Fuller
2022-09-20 08:51:19 +01:00
parent 32aa3b4b20
commit 70e6bb0162
2 changed files with 5 additions and 2 deletions

View File

@@ -1205,7 +1205,7 @@ function _pipeline (callback) {
this.push(data);
}
this.push(null);
this.emit('close');
this.on('end', () => this.emit('close'));
});
});
if (this.streamInFinished) {
@@ -1221,7 +1221,7 @@ function _pipeline (callback) {
this.push(data);
}
this.push(null);
this.emit('close');
this.on('end', () => this.emit('close'));
});
}
return this;