Skip to content

Commit bac7fe0

Browse files
ronagtargos
authored andcommitted
stream: remove no longer necessary ComposeDuplex
PR-URL: #40545 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
1 parent 841f35c commit bac7fe0

1 file changed

Lines changed: 1 addition & 23 deletions

File tree

‎lib/internal/streams/compose.js‎

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,6 @@ const {
1616
},
1717
}=require('internal/errors');
1818

19-
// This is needed for pre node 17.
20-
classComposeDuplexextendsDuplex{
21-
constructor(options){
22-
super(options);
23-
24-
// https://github.com/nodejs/node/pull/34385
25-
26-
if(options?.readable===false){
27-
this._readableState.readable=false;
28-
this._readableState.ended=true;
29-
this._readableState.endEmitted=true;
30-
}
31-
32-
if(options?.writable===false){
33-
this._writableState.writable=false;
34-
this._writableState.ending=true;
35-
this._writableState.ended=true;
36-
this._writableState.finished=true;
37-
}
38-
}
39-
}
40-
4119
module.exports=functioncompose(...streams){
4220
if(streams.length===0){
4321
thrownewERR_MISSING_ARGS('streams');
@@ -107,7 +85,7 @@ module.exports = function compose(...streams) {
10785
// TODO(ronag): Avoid double buffering.
10886
// Implement Writable/Readable/Duplex traits.
10987
// See, https://github.com/nodejs/node/pull/33515.
110-
d=newComposeDuplex({
88+
d=newDuplex({
11189
// TODO (ronag): highWaterMark?
11290
writableObjectMode: !!head?.writableObjectMode,
11391
readableObjectMode: !!tail?.writableObjectMode,

0 commit comments

Comments
 (0)