commit
This commit is contained in:
parent
70e2f7a8aa
commit
008d2f30d7
675 changed files with 189892 additions and 0 deletions
33
node_modules/ky-universal/index.js
generated
vendored
Normal file
33
node_modules/ky-universal/index.js
generated
vendored
Normal file
|
@ -0,0 +1,33 @@
|
|||
'use strict';
|
||||
const fetch = require('node-fetch');
|
||||
const AbortController = require('abort-controller');
|
||||
|
||||
const TEN_MEGABYTES = 1000 * 1000 * 10;
|
||||
|
||||
if (!global.fetch) {
|
||||
global.fetch = (url, options) => fetch(url, {highWaterMark: TEN_MEGABYTES, ...options});
|
||||
}
|
||||
|
||||
if (!global.Headers) {
|
||||
global.Headers = fetch.Headers;
|
||||
}
|
||||
|
||||
if (!global.Request) {
|
||||
global.Request = fetch.Request;
|
||||
}
|
||||
|
||||
if (!global.Response) {
|
||||
global.Response = fetch.Response;
|
||||
}
|
||||
|
||||
if (!global.AbortController) {
|
||||
global.AbortController = AbortController;
|
||||
}
|
||||
|
||||
if (!global.ReadableStream) {
|
||||
try {
|
||||
global.ReadableStream = require('web-streams-polyfill/ponyfill/es2018');
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
module.exports = require('ky/umd');
|
Loading…
Add table
Add a link
Reference in a new issue