Skip to content

Commit 60c03ab

Browse files
committed
Remove spurious reference to process.
Fixes #1257
1 parent 69d90c6 commit 60c03ab

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/jsutils/instanceOf.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,14 @@ declare function instanceOf(
1616
constructor: mixed,
1717
): boolean %checks(value instanceof constructor);
1818

19-
export default (process && process.env.NODE_ENV !== 'production'
19+
// See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production
20+
// See: https://webpack.js.org/guides/production/
21+
export default (process.env.NODE_ENV === 'production'
2022
? // eslint-disable-next-line no-shadow
23+
function instanceOf(value: any, constructor: any) {
24+
return value instanceof constructor;
25+
}
26+
: // eslint-disable-next-line no-shadow
2127
function instanceOf(value: any, constructor: any) {
2228
if (value instanceof constructor) {
2329
return true;
@@ -43,8 +49,4 @@ spurious results.`,
4349
}
4450
}
4551
return false;
46-
}
47-
: // eslint-disable-next-line no-shadow
48-
function instanceOf(value: any, constructor: any) {
49-
return value instanceof constructor;
5052
});

0 commit comments

Comments
 (0)