From 57662ae83460bee94d208a971a81ef3b94d7be41 Mon Sep 17 00:00:00 2001 From: Ivan Goncharov Date: Fri, 22 Jan 2021 22:00:02 +0200 Subject: [PATCH] Simplify isAsyncIterable (#2889) --- 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'; }