Skip to content

Commit bac7fe0

Browse files
ronagtargos
authored andcommitted
stream: remove no longer necessary ComposeDuplex
PR-URL: #40545 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
1 parent 841f35c commit bac7fe0

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

lib/internal/streams/compose.js

+1-23
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-
class ComposeDuplex extends Duplex {
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 = function compose(...streams) {
4220
if (streams.length === 0) {
4321
throw new ERR_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 = new ComposeDuplex({
88+
d = new Duplex({
11189
// TODO (ronag): highWaterMark?
11290
writableObjectMode: !!head?.writableObjectMode,
11391
readableObjectMode: !!tail?.writableObjectMode,

0 commit comments

Comments
 (0)