We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1190c8f commit 6d688d3Copy full SHA for 6d688d3
src/index.js
@@ -15,10 +15,11 @@ const isNode =
15
* @see https://github.com/jsdom/jsdom/releases/tag/12.0.0
16
* @see https://github.com/jsdom/jsdom/issues/1537
17
*/
18
-const isJsDom = (() =>
+const isJsDom =
19
(typeof window !== "undefined" && window.name === "nodejs") ||
20
- navigator.userAgent.includes("Node.js") ||
21
- navigator.userAgent.includes("jsdom"))();
+ (typeof navigator !== "undefined" &&
+ (navigator.userAgent.includes("Node.js") ||
22
+ navigator.userAgent.includes("jsdom")));
23
24
const isDeno = typeof Deno !== "undefined" && typeof Deno.core !== "undefined";
25
0 commit comments