db/events: remove unnecessary overloads

This commit is contained in:
Alex Gleason 2023-08-16 12:57:02 -05:00
parent 8f45f3a7ad
commit 4602b85afe
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 2 additions and 4 deletions

View File

@ -105,9 +105,7 @@ function getFilterQuery(filter: DittoFilter) {
} }
/** Get events for filters from the database. */ /** Get events for filters from the database. */
async function getFilters<K extends number>(filters: [DittoFilter<K>]): Promise<SignedEvent<K>[]>; async function getFilters<K extends number>(filters: DittoFilter<K>[]): Promise<SignedEvent<K>[]> {
async function getFilters(filters: DittoFilter[]): Promise<SignedEvent[]>;
async function getFilters(filters: DittoFilter[]) {
const queries = filters const queries = filters
.map(getFilterQuery) .map(getFilterQuery)
.map((query) => query.execute()); .map((query) => query.execute());
@ -115,7 +113,7 @@ async function getFilters(filters: DittoFilter[]) {
const events = (await Promise.all(queries)).flat(); const events = (await Promise.all(queries)).flat();
return events.map((event) => ( return events.map((event) => (
{ ...event, tags: JSON.parse(event.tags) } { ...event, tags: JSON.parse(event.tags) } as SignedEvent<K>
)); ));
} }