Skip to content

Commit

Permalink
Simplify isAsyncIterable (#2889)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed Jan 22, 2021
1 parent f0502f9 commit 57662ae
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/jsutils/isAsyncIterable.js
Expand Up @@ -9,9 +9,5 @@ declare function isAsyncIterable(value: mixed): boolean %checks(value instanceof

// eslint-disable-next-line no-redeclare
export default function isAsyncIterable(maybeAsyncIterable) {
if (maybeAsyncIterable == null || typeof maybeAsyncIterable !== 'object') {
return false;
}

return typeof maybeAsyncIterable[SYMBOL_ASYNC_ITERATOR] === 'function';
return typeof maybeAsyncIterable?.[SYMBOL_ASYNC_ITERATOR] === 'function';
}

0 comments on commit 57662ae

Please sign in to comment.