(events: RelayEvent[])
| 16 | const THREAD_CONTEXT_LIMIT = 100; |
| 17 | |
| 18 | function dedupeEvents(events: RelayEvent[]): RelayEvent[] { |
| 19 | const eventsById = new Map<string, RelayEvent>(); |
| 20 | for (const event of events) { |
| 21 | eventsById.set(event.id, event); |
| 22 | } |
| 23 | return [...eventsById.values()].sort((a, b) => a.created_at - b.created_at); |
| 24 | } |
| 25 | |
| 26 | function getThreadRootId(event: RelayEvent): string { |
| 27 | const thread = getThreadReference(event.tags); |
no test coverage detected