From f4e2387e8bbdcf141515512484f7f2289416b94d Mon Sep 17 00:00:00 2001 From: mobsean Date: Tue, 13 Feb 2024 15:57:14 +0100 Subject: [PATCH 1/2] fix#3978 --- 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 c84bcb2afc..75e64b5870 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 != null && 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; } From 4dab3cef966172c5054fdfd97bced7e9132caa29 Mon Sep 17 00:00:00 2001 From: mobsean Date: Wed, 14 Feb 2024 09:48:56 +0100 Subject: [PATCH 2/2] as recommended --- 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 75e64b5870..5ea6155534 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 != null && globalThis[process.env.NODE_ENV] === 'production' + globalThis.process != null && globalThis['development' | 'production'] === 'production' ? function instanceOf(value: unknown, constructor: Constructor): boolean { return value instanceof constructor; }