Skip to content

Commit

Permalink
stream: remove unreachable code
Browse files Browse the repository at this point in the history
isIterable() is called in one place with only one argument, so the
second argument and associated logic for it can be removed.
  • Loading branch information
Trott committed Feb 24, 2021
1 parent 67dc2bf commit 5998703
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/stream/promises.js
Expand Up @@ -30,10 +30,8 @@ function isStream(obj) {
return isReadable(obj) || isWritable(obj);
}

function isIterable(obj, isAsync) {
function isIterable(obj) {
if (!obj) return false;
if (isAsync === true) return typeof obj[SymbolAsyncIterator] === 'function';
if (isAsync === false) return typeof obj[SymbolIterator] === 'function';
return typeof obj[SymbolAsyncIterator] === 'function' ||
typeof obj[SymbolIterator] === 'function';
}
Expand Down

0 comments on commit 5998703

Please sign in to comment.