-
Notifications
You must be signed in to change notification settings - Fork 0
/
global.ts
36 lines (29 loc) · 900 Bytes
/
global.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { Platform, LogBox } from "react-native";
export interface Global {
btoa: any
atob: any
self: any
Buffer: any
process: any
location: any
}
declare var global: Global
if (typeof global.self === 'undefined') {
global.self = global
}
if (Platform.OS !== "web") {
require("react-native-get-random-values");
LogBox.ignoreLogs([
"Warning: The provided value 'ms-stream' is not a valid 'responseType'.",
"Warning: The provided value 'moz-chunked-arraybuffer' is not a valid 'responseType'.",
]);
}
global.btoa = global.btoa || require('base-64').encode;
global.atob = global.atob || require('base-64').decode;
global.Buffer = require('buffer').Buffer
global.process = require('process')
global.process.env.NODE_ENV = __DEV__ ? 'development' : 'production';
global.process.version = 'v9.40';
global.location = {
protocol: 'https',
}