fix: resolve lint and type errors

- Changed idToEvent from let to const (prefer-const)
- Fixed TypeScript type narrowing issue by using direct regex test instead of isHexId type guard
- Removed unused isHexId import

All lint and type checks now pass for src directory.
This commit is contained in:
Gigi
2025-10-15 16:09:46 +02:00
parent 2193a7a863
commit 401a8241bd

View File

@@ -5,7 +5,6 @@ import {
dedupeNip51Events,
hydrateItems,
isAccountWithExtension,
isHexId,
hasNip04Decrypt,
hasNip44Decrypt,
dedupeBookmarksById,
@@ -120,7 +119,8 @@ export const fetchBookmarks = async (
const coordinates: string[] = []
allItems.forEach(i => {
if (isHexId(i.id)) {
// Check if it's a hex ID (64 character hex string)
if (/^[0-9a-f]{64}$/i.test(i.id)) {
noteIds.push(i.id)
} else if (i.id.includes(':')) {
// Coordinate format: kind:pubkey:identifier
@@ -128,7 +128,7 @@ export const fetchBookmarks = async (
}
})
let idToEvent: Map<string, NostrEvent> = new Map()
const idToEvent: Map<string, NostrEvent> = new Map()
// Fetch regular events by ID
if (noteIds.length > 0) {