fix: Check for global.fetch before binding it (#674)

This commit is contained in:
Boris Bosiljcic 2019-09-16 13:52:22 +02:00 committed by Richie Bendall
parent 1d5778ad0d
commit 5535c2ed47
1 changed files with 3 additions and 1 deletions

View File

@ -16,7 +16,9 @@ var global = getGlobal();
module.exports = exports = global.fetch;
// Needed for TypeScript and Webpack.
exports.default = global.fetch.bind(global);
if (global.fetch) {
exports.default = global.fetch.bind(global);
}
exports.Headers = global.Headers;
exports.Request = global.Request;