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:36 -03:00
parent c5b64404f6
commit c08bdac7a7
No known key found for this signature in database
GPG Key ID: BAD43C4BE5C1A3A1
1 changed files with 5 additions and 1 deletions

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