diff --git a/src/jsutils/instanceOf.js b/src/jsutils/instanceOf.js index 6b7c17576b..d45b58f0f0 100644 --- a/src/jsutils/instanceOf.js +++ b/src/jsutils/instanceOf.js @@ -11,7 +11,7 @@ declare function instanceOf( // See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production // See: https://webpack.js.org/guides/production/ -export default isProductionEnvironment() +export default process.env.NODE_ENV === 'production' ? // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') // eslint-disable-next-line no-shadow function instanceOf(value: mixed, constructor: mixed) { @@ -44,28 +44,3 @@ spurious results.`, } return false; }; - -/* global Deno */ -/* :: declare var Deno: any; */ - -function isProductionEnvironment() { - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') - try { - if (process.env.NODE_ENV === 'production') { - return true; - } - } catch (e) { - // ignore - } - - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') - try { - if (Deno.env.get('DENO_ENV') === 'production') { - return true; - } - } catch (e) { - // ignore - } - - return false; -}