Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bac7fe0

Browse filesBrowse 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
Copy full SHA for bac7fe0

File tree

Expand file treeCollapse file tree

1 file changed

+1
-23
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-23
lines changed
Open diff view settings
Collapse file

‎lib/internal/streams/compose.js‎

Copy file name to clipboardExpand all lines: lib/internal/streams/compose.js
+1-23Lines 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-
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.