We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0516093 commit 438755fCopy full SHA for 438755f
src/helper.ts
@@ -1,13 +1,11 @@
1
-import crossFetch from 'cross-fetch'
2
-
3
type Fetch = typeof fetch
4
5
export const resolveFetch = (customFetch?: Fetch): Fetch => {
6
let _fetch: Fetch
7
if (customFetch) {
8
_fetch = customFetch
9
} else if (typeof fetch === 'undefined') {
10
- _fetch = crossFetch as unknown as Fetch
+ _fetch = async (...args) => await (await import('cross-fetch')).fetch(...args)
11
} else {
12
_fetch = fetch
13
}
0 commit comments