Skip to content

Commit 8e7cc02

Browse files
committed
Checks typeof process in instanceOf before using it
1 parent 40aa07b commit 8e7cc02

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/jsutils/instanceOf.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ declare function instanceOf(
1111

1212
// See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production
1313
// See: https://webpack.js.org/guides/production/
14-
export default process.env.NODE_ENV === 'production'
14+
export default typeof process !== 'undefined' &&
15+
process.env.NODE_ENV === 'production'
1516
? // eslint-disable-next-line no-shadow
1617
function instanceOf(value: mixed, constructor: mixed) {
1718
return value instanceof constructor;

0 commit comments

Comments
 (0)