Skip to content

Commit 4131f94

Browse files
Ayase-252danielleadams
authored andcommittedMay 31, 2021
stream: allow empty string as source of pipeline
Fixes: #38721 PR-URL: #38723 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
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)
Please sign in to comment.