12345678910111213141516171819202122 |
- const nodeFetch = require('node-fetch')
- const realFetch = nodeFetch.default || nodeFetch
- const fetch = function (url, options) {
-
-
- if (/^\/\//.test(url)) {
- url = 'https:' + url
- }
- return realFetch.call(this, url, options)
- }
- fetch.ponyfill = true
- module.exports = exports = fetch
- exports.fetch = fetch
- exports.Headers = nodeFetch.Headers
- exports.Request = nodeFetch.Request
- exports.Response = nodeFetch.Response
- exports.default = fetch
|