@@ -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-
4119module.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