From 27b971eef3ce675a29da7d2499c08930f8875967 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 13 Jul 2023 10:48:22 -0500 Subject: [PATCH 1/2] Fix nip27 type --- nip27.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nip27.ts b/nip27.ts index abededc..fac7d59 100644 --- a/nip27.ts +++ b/nip27.ts @@ -13,7 +13,7 @@ export interface NostrURIMatch extends NostrURI { } /** Find and decode all NIP-21 URIs. */ -export function* matchAll(content: string): Iterable { +export function * matchAll(content: string): Iterable { const matches = content.matchAll(regex()) for (const match of matches) { @@ -56,7 +56,7 @@ export function replaceAll( content: string, replacer: (match: NostrURI) => string ): string { - return content.replaceAll(regex(), (uri, value) => { + return content.replaceAll(regex(), (uri, value: string) => { return replacer({ uri: uri as `nostr:${string}`, value, From bb3e41bb8955011fc6a1a875afbe2debb298894d Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 13 Jul 2023 10:57:30 -0500 Subject: [PATCH 2/2] Also remove failing nip05 test due to server down (this should be mocked) --- nip05.test.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/nip05.test.ts b/nip05.test.ts index 832826d..388f03a 100644 --- a/nip05.test.ts +++ b/nip05.test.ts @@ -17,17 +17,11 @@ test('fetch nip05 profiles', async () => { ) expect(p2!.relays).toEqual(['wss://relay.damus.io']) - let p3 = await queryProfile('channel.ninja@channel.ninja') + let p3 = await queryProfile('_@fiatjaf.com') expect(p3!.pubkey).toEqual( - '36e65b503eba8a6b698e724a59137603101166a1cddb45ddc704247fc8aa0fce' - ) - expect(p3!.relays).toEqual(undefined) - - let p4 = await queryProfile('_@fiatjaf.com') - expect(p4!.pubkey).toEqual( '3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d' ) - expect(p4!.relays).toEqual([ + expect(p3!.relays).toEqual([ 'wss://relay.nostr.bg', 'wss://nos.lol', 'wss://nostr-verified.wellorder.net',