fix logic and add unit tests

This commit is contained in:
Sam Samskies
2023-04-20 15:01:29 -05:00
parent b068c00b7f
commit 969284e47b
3 changed files with 31 additions and 2 deletions

View File

@ -499,7 +499,11 @@ export function validateNostrLink(link: string): boolean {
return false;
}
return parsedLink.id.length === 64;
if (parsedLink.type === NostrPrefix.PublicKey || parsedLink.type === NostrPrefix.Note) {
return parsedLink.id.length === 64;
}
return true;
} catch {
return false;
}