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‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function isStream(obj){
2020
}
2121

2222
functionisIterable(obj,isAsync){
23-
if(!obj)returnfalse;
23+
if(obj==null)returnfalse;
2424
if(isAsync===true)returntypeofobj[SymbolAsyncIterator]==='function';
2525
if(isAsync===false)returntypeofobj[SymbolIterator]==='function';
2626
returntypeofobj[SymbolAsyncIterator]==='function'||
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
'use strict';
2+
3+
constcommon=require('../common');
4+
const{
5+
pipeline,
6+
PassThrough
7+
}=require('stream');
8+
9+
10+
asyncfunctionrunTest(){
11+
awaitpipeline(
12+
'',
13+
newPassThrough({objectMode: true}),
14+
common.mustCall(()=>{})
15+
);
16+
}
17+
18+
runTest().then(common.mustCall(()=>{}));

0 commit comments

Comments
(0)