support deno fetch

This commit is contained in:
silverwind 2022-12-23 22:19:37 +01:00
parent 775cb0a426
commit 560bd67655
Signed by: silverwind
GPG Key ID: 2E62B41C93869443

@ -17,7 +17,14 @@ import {rootCertificates} from "node:tls";
import {timerel} from "timerel";
const {fromUrl} = hostedGitInfo;
const fetch = fetchEnhanced(nodeFetch, {undici: false});
let fetch;
if (globalThis.Deno && globalThis.fetch) {
fetch = globalThis.fetch;
} else {
fetch = fetchEnhanced(nodeFetch, {undici: false});
}
const MAX_SOCKETS = 96;
const sep = "\0";