Skip to content

Commit 605153f

Browse files
Merge pull request #18 from matthew-andrews/dont-force-fetch
Don't redefine global fetch.
2 parents 1bb628e + 6ce72e7 commit 605153f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

server.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
"use strict";
22

33
var realFetch = require('node-fetch');
4-
module.exports = global.fetch = function(url, options) {
4+
module.exports = function(url, options) {
55
if (/^\/\//.test(url)) {
66
url = 'https:' + url;
77
}
88
return realFetch.call(this, url, options);
99
};
10+
11+
if (!global.fetch) {
12+
global.fetch = module.exports;
13+
}

0 commit comments

Comments
 (0)