1 | import process from 'process';
|
2 | export function isNode() {
|
3 | |
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | return typeof process !== 'undefined' && !process.browser;
|
11 | }
|
12 | export function isReactNative() {
|
13 | return (typeof window !== 'undefined' &&
|
14 | 'navigator' in window &&
|
15 | 'product' in window.navigator &&
|
16 | window.navigator.product === 'ReactNative');
|
17 | }
|
18 | export function getNodeVersion() {
|
19 | return process.versions && process.versions.node ? `v${process.versions.node}` : process.version;
|
20 | }
|
21 | export function getWindow() {
|
22 | return window;
|
23 | }
|
24 | export function noop() {
|
25 | return undefined;
|
26 | }
|