1
1
import { inspect } from './inspect.js' ;
2
2
3
3
/* c8 ignore next 3 */
4
- const isDevelopment =
5
- globalThis . process != null &&
4
+ const isProduction =
5
+ globalThis . process == null ||
6
6
// eslint-disable-next-line no-undef
7
- process . env . NODE_ENV === 'development' ;
7
+ ( process . env . NODE_ENV !== 'development' &&
8
+ // eslint-disable-next-line no-undef
9
+ process . env . NODE_ENV !== 'test' ) ;
8
10
9
11
/**
10
12
* A replacement for instanceof which includes an error warning when multi-realm
@@ -13,8 +15,13 @@ const isDevelopment =
13
15
* See: https://webpack.js.org/guides/production/
14
16
*/
15
17
export const instanceOf : ( value : unknown , constructor : Constructor ) => boolean =
16
- isDevelopment
18
+ /* c8 ignore next 6 */
19
+ // FIXME: https://github.com/graphql/graphql-js/issues/2317
20
+ isProduction
17
21
? function instanceOf ( value : unknown , constructor : Constructor ) : boolean {
22
+ return value instanceof constructor ;
23
+ }
24
+ : function instanceOf ( value : unknown , constructor : Constructor ) : boolean {
18
25
if ( value instanceof constructor ) {
19
26
return true ;
20
27
}
@@ -45,11 +52,6 @@ spurious results.`,
45
52
}
46
53
}
47
54
return false ;
48
- }
49
- : /* c8 ignore next 4 */
50
- // FIXME: https://github.com/graphql/graphql-js/issues/2317
51
- function instanceOf ( value : unknown , constructor : Constructor ) : boolean {
52
- return value instanceof constructor ;
53
55
} ;
54
56
55
57
interface Constructor extends Function {
0 commit comments