From c08bdac7a7ff14e51b78cfa8ecfe6700670fb302 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Fri, 23 Dec 2022 11:36:36 -0300 Subject: [PATCH] catch usage of global fetch for nodejs. fixes https://github.com/fiatjaf/nostr-tools/issues/53 --- nip05.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nip05.ts b/nip05.ts index 3c4e6fe..b5dccd2 100644 --- a/nip05.ts +++ b/nip05.ts @@ -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