1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.isReactNativeBrowser = exports.isWebWorker = void 0;
|
4 | const isStandardBrowserEnv = () => typeof window !== 'undefined' && typeof window.document !== 'undefined';
|
5 | const isWebWorkerEnv = () => {
|
6 | var _a, _b;
|
7 | return Boolean(typeof self === 'object' &&
|
8 | ((_b = (_a = self === null || self === void 0 ? void 0 : self.constructor) === null || _a === void 0 ? void 0 : _a.name) === null || _b === void 0 ? void 0 : _b.includes('WorkerGlobalScope')));
|
9 | };
|
10 | const isReactNativeEnv = () => typeof navigator !== 'undefined' && navigator.product === 'ReactNative';
|
11 | const isBrowser = isStandardBrowserEnv() || isWebWorkerEnv() || isReactNativeEnv();
|
12 | exports.isWebWorker = isWebWorkerEnv();
|
13 | exports.isReactNativeBrowser = isReactNativeEnv();
|
14 | exports.default = isBrowser;
|
15 |
|
\ | No newline at end of file |