mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-10 17:18:51 +00:00
@@ -17,17 +17,11 @@ test('fetch nip05 profiles', async () => {
|
|||||||
)
|
)
|
||||||
expect(p2!.relays).toEqual(['wss://relay.damus.io'])
|
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(
|
expect(p3!.pubkey).toEqual(
|
||||||
'36e65b503eba8a6b698e724a59137603101166a1cddb45ddc704247fc8aa0fce'
|
|
||||||
)
|
|
||||||
expect(p3!.relays).toEqual(undefined)
|
|
||||||
|
|
||||||
let p4 = await queryProfile('_@fiatjaf.com')
|
|
||||||
expect(p4!.pubkey).toEqual(
|
|
||||||
'3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d'
|
'3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d'
|
||||||
)
|
)
|
||||||
expect(p4!.relays).toEqual([
|
expect(p3!.relays).toEqual([
|
||||||
'wss://relay.nostr.bg',
|
'wss://relay.nostr.bg',
|
||||||
'wss://nos.lol',
|
'wss://nos.lol',
|
||||||
'wss://nostr-verified.wellorder.net',
|
'wss://nostr-verified.wellorder.net',
|
||||||
|
|||||||
2
nip27.ts
2
nip27.ts
@@ -56,7 +56,7 @@ export function replaceAll(
|
|||||||
content: string,
|
content: string,
|
||||||
replacer: (match: NostrURI) => string
|
replacer: (match: NostrURI) => string
|
||||||
): string {
|
): string {
|
||||||
return content.replaceAll(regex(), (uri, value) => {
|
return content.replaceAll(regex(), (uri, value: string) => {
|
||||||
return replacer({
|
return replacer({
|
||||||
uri: uri as `nostr:${string}`,
|
uri: uri as `nostr:${string}`,
|
||||||
value,
|
value,
|
||||||
|
|||||||
Reference in New Issue
Block a user