Rename files

This commit is contained in:
2023-06-21 16:48:35 +01:00
parent 0cd43a731e
commit 7ec602cc16
51 changed files with 98 additions and 98 deletions

View File

@ -0,0 +1,20 @@
import { NostrEvent, ReqFilter } from "./nostr";
export function eventMatchesFilter(ev: NostrEvent, filter: ReqFilter) {
if (!(filter.ids?.includes(ev.id) ?? false)) {
return false;
}
if (!(filter.authors?.includes(ev.pubkey) ?? false)) {
return false;
}
if (!(filter.kinds?.includes(ev.kind) ?? false)) {
return false;
}
if (filter.since && ev.created_at < filter.since) {
return false;
}
if (filter.until && ev.created_at > filter.until) {
return false;
}
return true;
}