selfcarebot/node_modules/@mastojs/ponyfills/index.cjs
2023-03-30 06:02:54 +00:00

25 lines
916 B
JavaScript

"use strict";
var NodeFetch = require("node-fetch");
var NodeFormData = require("form-data");
var buffer = require("buffer");
var NodeAbortController = require("abort-controller");
const Blob = globalThis.Blob ?? buffer.Blob;
const FormData = globalThis.FormData ?? NodeFormData;
const Headers = globalThis.Headers ?? NodeFetch.Headers;
const Request = globalThis.Request ?? NodeFetch.Request;
const Response = globalThis.Response ?? NodeFetch.Response;
const fetch = globalThis.fetch ?? NodeFetch.default;
const AbortController =
globalThis.AbortController ?? NodeAbortController.AbortController;
const AbortSignal = globalThis.AbortSignal ?? NodeAbortController.AbortSignal;
exports.Blob = Blob;
exports.FormData = FormData;
exports.Headers = Headers;
exports.Request = Request;
exports.Response = Response;
exports.fetch = fetch;
exports.AbortController = AbortController;
exports.AbortSignal = AbortSignal;