streamline and improve benchmarks.

This commit is contained in:
fiatjaf
2023-12-22 06:57:23 -03:00
parent 83b6dd7ec3
commit 7adbd30799
4 changed files with 20 additions and 30 deletions

View File

@@ -1,4 +1,4 @@
import { verifiedSymbol, type Event, type Nostr } from './core.ts'
import { verifiedSymbol, type Event, type Nostr, VerifiedEvent } from './core.ts'
export async function yieldThread() {
return new Promise(resolve => {
@@ -10,7 +10,7 @@ export async function yieldThread() {
})
}
export const alwaysTrue: Nostr['verifyEvent'] = (t: Event) => {
export const alwaysTrue: Nostr['verifyEvent'] = (t: Event): t is VerifiedEvent => {
t[verifiedSymbol] = true
return t[verifiedSymbol]
return true
}