browser-or-node icon indicating copy to clipboard operation
browser-or-node copied to clipboard

[BUG] `isJsDom` should not be true when node v21.1.0

Open loynoir opened this issue 1 year ago • 0 comments

https://github.com/flexdinesh/browser-or-node/blob/9875469e69b0dbc6a35e50b104495facf869bb4a/src/index.js#L18-L22

$ node
Welcome to Node.js v21.1.0.
Type ".help" for more information.
> 
> isJsDom = 
...    (typeof window !== "undefined" && window.name === "nodejs") || 
...    (typeof navigator !== "undefined" && 
...      (navigator.userAgent.includes("Node.js") || 
...        navigator.userAgent.includes("jsdom"))); 
true

loynoir avatar Nov 11 '23 18:11 loynoir