Files
memecoin-botV2/.pnpm-store/v10/files/05/2a3ee564c6b2f39a544a32ac6b7cace22328d9ea9526189650ca620f9924e94f996ecda6addfcdd30dd5085e892c9e79cd5b1e459341d7a1bb85adc3d11bd5

17 lines
608 B
Plaintext

import * as nodeFetch from 'node-fetch';
export default (typeof globalThis.fetch === 'function'
? // The Fetch API is supported experimentally in Node 17.5+ and natively in Node 18+.
globalThis.fetch
: // Otherwise use the polyfill.
async function (
input: nodeFetch.RequestInfo,
init?: nodeFetch.RequestInit,
): Promise<nodeFetch.Response> {
const processedInput =
typeof input === 'string' && input.slice(0, 2) === '//'
? 'https:' + input
: input;
return await nodeFetch.default(processedInput, init);
}) as typeof globalThis.fetch;