Swap-Aggregator-Subgraph/node_modules/ky-universal/index.js
Richa-iitr d211083153 Revert "Revert "added handler""
This reverts commit c36ee8c5ca.
2022-07-03 07:30:05 +05:30

40 lines
719 B
JavaScript

'use strict';
const {URL, URLSearchParams} = require('url');
const fetch = require('node-fetch');
const AbortController = require('abort-controller');
if (!global.URL) {
global.URL = URL;
}
if (!global.URLSearchParams) {
global.URLSearchParams = URLSearchParams;
}
if (!global.fetch) {
global.fetch = fetch;
}
if (!global.Headers) {
global.Headers = fetch.Headers;
}
if (!global.Response) {
global.Response = fetch.Response;
}
if (!global.AbortController) {
global.AbortController = AbortController;
}
const {
default: ky,
HTTPError,
TimeoutError
} = require('ky/umd');
module.exports = ky;
module.exports.default = ky;
module.exports.HTTPError = HTTPError;
module.exports.TimeoutError = TimeoutError;