Skip to content

Commit

Permalink
fix: browser detection
Browse files Browse the repository at this point in the history
Fixes #1671
  • Loading branch information
robertsLando committed Aug 16, 2023
1 parent 94ab684 commit 183b35a
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/lib/is-browser.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
const legacyIsBrowser =
(typeof process !== 'undefined' && process.title === 'browser') ||
// eslint-disable-next-line camelcase, @typescript-eslint/ban-ts-comment
// @ts-ignore
typeof __webpack_require__ === 'function'

const isBrowser =
typeof window !== 'undefined' && typeof document !== 'undefined'

const IS_BROWSER = isBrowser || legacyIsBrowser
typeof window !== 'undefined' && typeof window.document !== 'undefined'

export default IS_BROWSER
export default isBrowser

0 comments on commit 183b35a

Please sign in to comment.