More re-work of Tags

This commit is contained in:
Jon Staab
2024-01-24 09:30:17 -08:00
parent 4fb072ec0a
commit aa963af77e
8 changed files with 427 additions and 160 deletions
+1 -13
View File
@@ -2,19 +2,7 @@ import type {Event} from 'nostr-tools'
import normalizeUrl from "normalize-url"
import {verifyEvent, getEventHash, matchFilter as nostrToolsMatchFilter} from 'nostr-tools'
import {cached} from "./LRUCache"
// ===========================================================================
// General-purpose
export const now = () => Math.round(Date.now() / 1000)
export const last = <T>(xs: T[]) => xs[xs.length - 1]
export const identity = <T>(x: T) => x
export const flatten = <T>(xs: T[]) => xs.flatMap(identity)
export const uniq = <T>(xs: T[]) => Array.from(new Set(xs))
import {now} from './misc'
// ===========================================================================
// Relays