We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 05e6de2 commit 28ed233Copy full SHA for 28ed233
src/utils/downloadFile.ts
@@ -2,7 +2,7 @@
2
* API for downloading information from web
3
*/
4
import { logger } from "./logger";
5
-import fetch from "node-fetch";
+import { fetch } from "./fetch";
6
7
export async function downloadFromMultiSources(urls: string[]): Promise<string | undefined> {
8
for (const url of urls) {
src/utils/fetch.ts
@@ -0,0 +1,7 @@
1
+/* eslint-disable @typescript-eslint/no-explicit-any */
+// @ts-check
+
+export const fetch =
+ process.platform
+ ? eval("(...args) => import('node-fetch').then(({default: fetch}) => fetch(...args))")
+ : window.fetch;
0 commit comments