Skip to content

Commit 4131f94

Browse files
Ayase-252danielleadams
authored andcommitted
stream: allow empty string as source of pipeline
Fixes: #38721 PR-URL: #38723 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Zijian Liu <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
1 parent 496f7ea commit 4131f94

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

lib/internal/streams/utils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function isStream(obj) {
2020
}
2121

2222
function isIterable(obj, isAsync) {
23-
if (!obj) return false;
23+
if (obj == null) return false;
2424
if (isAsync === true) return typeof obj[SymbolAsyncIterator] === 'function';
2525
if (isAsync === false) return typeof obj[SymbolIterator] === 'function';
2626
return typeof obj[SymbolAsyncIterator] === 'function' ||
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
const {
5+
pipeline,
6+
PassThrough
7+
} = require('stream');
8+
9+
10+
async function runTest() {
11+
await pipeline(
12+
'',
13+
new PassThrough({ objectMode: true }),
14+
common.mustCall(() => { })
15+
);
16+
}
17+
18+
runTest().then(common.mustCall(() => {}));

0 commit comments

Comments
 (0)