sitsunt
Version:
JS Client library to interact with Supabase Functions.
14 lines (12 loc) • 363 B
text/typescript
import { Fetch } from './types'
export const resolveFetch = (customFetch?: Fetch): Fetch => {
let _fetch: Fetch
if (customFetch) {
_fetch = customFetch
} else if (typeof fetch === 'undefined') {
_fetch = async (...args) => await (await import('cross-fetch')).fetch(...args)
} else {
_fetch = fetch
}
return (...args) => _fetch(...args)
}