UNPKG

is-in-browser

Version:

Simple check to see if current app is running in browser

15 lines (13 loc) 607 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.isBrowser = exports.isNode = exports.isJsDom = void 0; const isJsDom = typeof navigator === "object" && navigator.userAgent && navigator.userAgent.includes("jsdom"); exports.isJsDom = isJsDom; const isNode = typeof process === "object" && !!process.versions && !!process.versions.node; exports.isNode = isNode; const isBrowser = typeof window === "object" && typeof document === "object" && document.nodeType === 9; exports.isBrowser = isBrowser; var _default = isBrowser; exports.default = _default;