File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 1
1
import { inspect } from './inspect.js' ;
2
2
3
+ function isProduction ( ) : boolean {
4
+ try {
5
+ // TODO: add checks for other environments
6
+ // eslint-disable-next-line no-undef
7
+ return process . env . NODE_ENV === 'production' ;
8
+ /* c8 ignore start */
9
+ } catch {
10
+ return true ;
11
+ }
12
+ /* c8 ignore stop */
13
+ }
14
+
3
15
/**
4
16
* A replacement for instanceof which includes an error warning when multi-realm
5
17
* constructors are detected.
@@ -9,7 +21,7 @@ import { inspect } from './inspect.js';
9
21
export const instanceOf : ( value : unknown , constructor : Constructor ) => boolean =
10
22
/* c8 ignore next 6 */
11
23
// FIXME: https://github.com/graphql/graphql-js/issues/2317
12
- globalThis . process != null && globalThis . process . env . NODE_ENV === 'production'
24
+ isProduction ( )
13
25
? function instanceOf ( value : unknown , constructor : Constructor ) : boolean {
14
26
return value instanceof constructor ;
15
27
}
You can’t perform that action at this time.
0 commit comments