UNPKG

365 BJavaScriptView Raw
1"use strict";
2
3var realFetch = require('node-fetch');
4module.exports = function(url, options) {
5 if (/^\/\//.test(url)) {
6 url = 'https:' + url;
7 }
8 return realFetch.call(this, url, options);
9};
10
11if (!global.fetch) {
12 global.fetch = module.exports;
13 global.Response = realFetch.Response;
14 global.Headers = realFetch.Headers;
15 global.Request = realFetch.Request;
16}