Skip to content

Commit

Permalink
Detect jsdom
Browse files Browse the repository at this point in the history
  • Loading branch information
yandeu committed Jul 18, 2023
1 parent dd1e916 commit 0683f44
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ export const detectSSR = (): boolean => {
// @ts-ignore
const isDeno = typeof Deno !== 'undefined'
const hasWindow = typeof window !== 'undefined' ? true : false
return (typeof _nano !== 'undefined' && _nano.isSSR) || isDeno || !hasWindow
const isNodejs = navigator.userAgent.includes('Node.js') || window.name == 'nodejs'
const iJsdom = navigator.userAgent.includes('jsdom')
return (typeof _nano !== 'undefined' && _nano.isSSR) || isDeno || !hasWindow || isNodejs || iJsdom
}

function isDescendant(desc: ParentNode | null, root: Node): boolean {
Expand Down

0 comments on commit 0683f44

Please sign in to comment.