catch usage of global fetch for nodejs.

fixes https://github.com/fiatjaf/nostr-tools/issues/53
This commit is contained in:
fiatjaf
2022-12-23 11:36:37 -03:00
parent c5b64404f6
commit c08bdac7a7
+5 -1
View File
@@ -1,6 +1,10 @@
import {ProfilePointer} from './nip19'
var _fetch = fetch
var _fetch: any
try {
_fetch = fetch
} catch {}
export function useFetchImplementation(fetchImplementation: any) {
_fetch = fetchImplementation