Spaces:
Running
Running
File size: 395 Bytes
5c05829 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | import { Fetch } from './types'
export const resolveFetch = (customFetch?: Fetch): Fetch => {
let _fetch: Fetch
if (customFetch) {
_fetch = customFetch
} else if (typeof fetch === 'undefined') {
_fetch = (...args) =>
import('@supabase/node-fetch' as any).then(({ default: fetch }) => fetch(...args))
} else {
_fetch = fetch
}
return (...args) => _fetch(...args)
}
|