diff options
| author | Adam Soltys <[email protected]> | 2026-02-24 13:18:42 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-02-24 13:18:42 -0800 |
| commit | ad7b09b43323d0ffc0a8ddabb43e4838a184c697 (patch) | |
| tree | fbf2a59f81771b2938f474c8e7b35a497d2960e4 /routes/nostr.ts | |
| parent | 9e97e040617bfa0b40150c0eba298bf186bbeeaf (diff) | |
| download | coinos-server-ad7b09b43323d0ffc0a8ddabb43e4838a184c697.tar.gz coinos-server-ad7b09b43323d0ffc0a8ddabb43e4838a184c697.zip | |
formatting
Diffstat (limited to 'routes/nostr.ts')
| -rw-r--r-- | routes/nostr.ts | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/routes/nostr.ts b/routes/nostr.ts index 9c61bf16..4436a1c7 100644 --- a/routes/nostr.ts +++ b/routes/nostr.ts @@ -40,9 +40,7 @@ export default { const parts = parseContent(event); let pubkeys = parts - .filter( - ({ type }) => type.includes("nprofile") || type.includes("npub"), - ) + .filter(({ type }) => type.includes("nprofile") || type.includes("npub")) .map(({ value }) => value.pubkey); const zapEvents = await scan({ kinds: [9735], "#e": [id] }); @@ -74,12 +72,7 @@ export default { }) ) .reduce((a, b) => { - a.set( - b.pubkey, - b.created_at > (a.get(b.pubkey)?.created_at || 0) - ? b - : a.get(b.pubkey), - ); + a.set(b.pubkey, b.created_at > (a.get(b.pubkey)?.created_at || 0) ? b : a.get(b.pubkey)); return a; }, new Map()) .values(); @@ -133,9 +126,7 @@ export default { const event = await get({ ids: [id] }); - const rootId = event.tags.find( - (tag) => tag[0] === "e" && tag[3] === "root", - )?.[1]; + const rootId = event.tags.find((tag) => tag[0] === "e" && tag[3] === "root")?.[1]; let root; if (rootId) root = await get({ ids: [rootId] }); @@ -262,9 +253,7 @@ export default { const event = await get({ authors: [pubkey], kinds: [3] }); if (!event) return res.send([]); - let pubkeys = event.tags - .filter((tag) => tag[0] === "p") - .map((tag) => tag[1]); + let pubkeys = event.tags.filter((tag) => tag[0] === "p").map((tag) => tag[1]); follows = []; if (pubkeysOnly) follows = pubkeys; |
