From 3921421f4cb3dae5d07b2c84b08acf80c1096d96 Mon Sep 17 00:00:00 2001 From: Ivan Goncharov Date: Tue, 19 Jan 2021 17:28:39 +0200 Subject: [PATCH] Simplify isAsyncIterable --- src/jsutils/isAsyncIterable.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/jsutils/isAsyncIterable.js b/src/jsutils/isAsyncIterable.js index 3dbbf9e214..813da5770a 100644 --- a/src/jsutils/isAsyncIterable.js +++ b/src/jsutils/isAsyncIterable.js @@ -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'; }