This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
admin-panel/graphql-types/node_modules/cross-fetch/dist/node-ponyfill.js

21 lines
595 B
JavaScript

var nodeFetch = require('node-fetch')
var realFetch = nodeFetch.default || nodeFetch
var fetch = function (url, options) {
// Support schemaless URIs on the server for parity with the browser.
// Ex: //github.com/ -> https://github.com/
if (/^\/\//.test(url)) {
url = 'https:' + url
}
return realFetch.call(this, url, options)
}
module.exports = exports = fetch
exports.fetch = fetch
exports.Headers = nodeFetch.Headers
exports.Request = nodeFetch.Request
exports.Response = nodeFetch.Response
// Needed for TypeScript consumers without esModuleInterop.
exports.default = fetch