web_lib

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

commit c3e7eb3e4726caedd3c2f1aff5688133aea94fae
parent caa3746d154386c09a4c171e3a01efa0f04a0aa8
Author: triesap <137732411+triesap@users.noreply.github.com>
Date:   Sat, 31 Aug 2024 09:56:09 +0000

client: edit iclientnostrlib, return falsy string in place of throwing error

Diffstat:
Mclient/src/nostr/lib.ts | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/client/src/nostr/lib.ts b/client/src/nostr/lib.ts @@ -45,7 +45,7 @@ export class ClientNostrLib implements IClientNostrLib { * @returns nostr public key hex */ public public_key(secret_key_hex: string | undefined): string { - if (!secret_key_hex) throw new Error('Error: Secret key hex'); + if (!secret_key_hex) return ``; const bytes = this.get_key_bytes(secret_key_hex); const hex = getPublicKey(bytes) return hex; @@ -56,7 +56,7 @@ export class ClientNostrLib implements IClientNostrLib { * @returns nostr public key npub */ public npub(public_key_hex: string | undefined): string { - if (!public_key_hex) throw new Error(`Error: public_key_hex must be defined`); + if (!public_key_hex) return ``; const npub = nip19.npubEncode(public_key_hex) return npub; }