Fix a type error

This commit is contained in:
Jon Staab
2024-11-14 13:45:23 -08:00
parent a3e5861468
commit 02617d9c24
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -50,7 +50,7 @@ export function cached<T, V, Args extends any[]>({
cache.set(k, getValue(args))
}
return cache.get(k)
return cache.get(k)!
}
get.cache = cache
+3 -1
View File
@@ -103,10 +103,12 @@ export const hasValidSignature = cached<string, boolean, [SignedEvent]>({
},
getValue: ([e]: [SignedEvent]) => {
try {
return verifyEvent(e)
verifyEvent(e)
} catch (err) {
return false
}
return true
},
})