1 | 'use strict';
|
2 |
|
3 | import { Platform } from 'react-native';
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | export function isJest() {
|
9 | return !!process.env.JEST_WORKER_ID;
|
10 | }
|
11 |
|
12 |
|
13 | export function isChromeDebugger() {
|
14 | return (!global.nativeCallSyncHook || !!global.__REMOTEDEV__) && !global.RN$Bridgeless;
|
15 | }
|
16 | export function isWeb() {
|
17 | return Platform.OS === 'web';
|
18 | }
|
19 | export function isAndroid() {
|
20 | return Platform.OS === 'android';
|
21 | }
|
22 | function isWindows() {
|
23 | return Platform.OS === 'windows';
|
24 | }
|
25 | export function shouldBeUseWeb() {
|
26 | return isJest() || isChromeDebugger() || isWeb() || isWindows();
|
27 | }
|
28 | export function isFabric() {
|
29 | return !!global._IS_FABRIC;
|
30 | }
|
31 | export function isWindowAvailable() {
|
32 |
|
33 |
|
34 |
|
35 |
|
36 | return typeof window !== 'undefined';
|
37 | }
|
38 |
|
\ | No newline at end of file |