Skip to content

Commit 963c965

Browse files
authored
improve reliability of the browser/node check
this fixes compatibility with a popular GTAV modification framework, FiveM. they define the window object as an alias for global, so the check was always returning true, causing various problems.
1 parent 9c2924a commit 963c965

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util/Constants.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const Package = exports.Package = require('../../package.json');
22
const { Error, RangeError } = require('../errors');
3-
const browser = exports.browser = typeof window !== 'undefined';
3+
const browser = exports.browser = typeof process === 'undefined';
44

55
/**
66
* Options for a client.

0 commit comments

Comments
 (0)