Skip to content

Commit dafe7d9

Browse files
committed
stream: allow using ReadableState as function
1 parent 118f9bc commit dafe7d9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/internal/streams/readable.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ const {
3636
Symbol,
3737
} = primordials;
3838

39+
module.exports = Readable;
40+
3941
const EE = require('events');
4042
const { Stream, prependListener } = require('internal/streams/legacy');
4143
const { Buffer } = require('buffer');
@@ -1708,5 +1710,7 @@ Readable.wrap = function(src, options) {
17081710
}).wrap(src);
17091711
};
17101712

1711-
module.exports = Readable;
1712-
Readable.ReadableState = ReadableState;
1713+
// Allow using ReadableState as function
1714+
Readable.ReadableState = function(...args) {
1715+
return new ReadableState(...args);
1716+
};

0 commit comments

Comments
 (0)