Skip to content
This repository was archived by the owner on May 1, 2021. It is now read-only.

Commit 3aee07d

Browse files
committed
Only call require if it is a defined function, fixes #34
1 parent 18b38eb commit 3aee07d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export {
5757
export { encodeQueryParams } from './encodeQueryParams';
5858
export { decodeQueryParams } from './decodeQueryParams';
5959

60-
if (process.env.NODE_ENV !== 'production') {
60+
if (process.env.NODE_ENV !== 'production' && typeof require === 'function') {
6161
/*
6262
* run checks to ensure a valid version of query-string is installed
6363
* see https://github.com/pbeshai/use-query-params/issues/127 for discussion

0 commit comments

Comments
 (0)