web_lib

Common web application libraries
git clone https://radroots.dev/git/web_lib.git
Log | Files | Refs | LICENSE

commit 662f07e82a23ed869c3cedd0ddf029a6bb791af2
parent 5443317bfd5e25c5e9c33df8efa9ebac74c33f39
Author: triesap <137732411+triesap@users.noreply.github.com>
Date:   Thu, 10 Apr 2025 23:49:04 +0000

utils-nostr: edit relay information document parsing util

Diffstat:
Mutils-nostr/src/lib/relay.ts | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utils-nostr/src/lib/relay.ts b/utils-nostr/src/lib/relay.ts @@ -14,7 +14,7 @@ export type NostrRelayInformationDocument = { export type NostrRelayInformationDocumentFields = { [K in keyof NostrRelayInformationDocument]: string; }; export const lib_nostr_relay_parse_information_document = (data: any): NostrRelayInformationDocument | undefined => { - const obj = JSON.parse(data); + const obj = typeof data === `string` ? JSON.parse(data) : data; return { id: typeof obj.id === 'string' ? obj.id : undefined, name: typeof obj.name === 'string' ? obj.name : undefined,