From 61025233e2123b5d3a4b729f5f329706bab19a70 Mon Sep 17 00:00:00 2001 From: Ivan Goncharov Date: Fri, 1 Sep 2023 15:45:15 +0300 Subject: [PATCH] instanceOf: workaround bundler issue with process.env (#3965) Port of #3923 from v16 to main (v17) --- src/jsutils/instanceOf.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jsutils/instanceOf.ts b/src/jsutils/instanceOf.ts index 489d63f42d..c84bcb2afc 100644 --- a/src/jsutils/instanceOf.ts +++ b/src/jsutils/instanceOf.ts @@ -9,7 +9,7 @@ import { inspect } from './inspect.js'; export const instanceOf: (value: unknown, constructor: Constructor) => boolean = /* c8 ignore next 6 */ // FIXME: https://github.com/graphql/graphql-js/issues/2317 - globalThis.process?.env.NODE_ENV === 'production' + globalThis.process != null && globalThis.process.env.NODE_ENV === 'production' ? function instanceOf(value: unknown, constructor: Constructor): boolean { return value instanceof constructor; }