1 | ;
|
2 |
|
3 | // ref: https://github.com/tc39/proposal-global
|
4 | var getGlobal = function () {
|
5 | // the only reliable means to get the global object is
|
6 | // `Function('return this')()`
|
7 | // However, this causes CSP violations in Chrome apps.
|
8 | if (typeof self !== 'undefined') { return self; }
|
9 | if (typeof window !== 'undefined') { return window; }
|
10 | if (typeof global !== 'undefined') { return global; }
|
11 | throw new Error('unable to locate global object');
|
12 | }
|
13 |
|
14 | var global = getGlobal();
|
15 |
|
16 | exports.Headers = global.Headers;
|
17 | exports.Request = global.Request;
|
18 | exports.Response = global.Response;
|
19 |
|
20 | exports.default = fetch;
|