From f87a17e609e2342b913b62f7f7701a3181d44494 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 29 Apr 2023 17:20:51 -0500 Subject: [PATCH] Remove unused code --- src/db.ts | 7 ------- src/deps.ts | 1 - src/gossip.ts | 21 --------------------- src/query.ts | 7 ------- 4 files changed, 36 deletions(-) delete mode 100644 src/db.ts delete mode 100644 src/gossip.ts delete mode 100644 src/query.ts diff --git a/src/db.ts b/src/db.ts deleted file mode 100644 index 022a952..0000000 --- a/src/db.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { lmdb } from '@/deps.ts'; - -const db = lmdb.open('db', {}); - -const gossipDB = db.openDB('gossip', { dupSort: true }); - -export { db, gossipDB }; diff --git a/src/deps.ts b/src/deps.ts index 27c051e..e12e028 100644 --- a/src/deps.ts +++ b/src/deps.ts @@ -18,4 +18,3 @@ export { nip21, signEvent as getSignature, } from 'npm:nostr-tools@^1.10.1'; -export { default as lmdb } from 'npm:lmdb'; diff --git a/src/gossip.ts b/src/gossip.ts deleted file mode 100644 index b5d8bbb..0000000 --- a/src/gossip.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { type Event } from '@/event.ts'; - -import { parseRelay } from './schema.ts'; - -/** Gets relays which pertain to the author from the event. */ -function getAuthorRelays(event: Event): URL[] { - const relays: string[] = []; - - switch (event.kind) { - case 10002: - event.tags.forEach((tag) => tag[0] === 'r' && relays.push(tag[1])); - break; - case 2: - relays.push(event.content); - break; - } - - return relays.map(parseRelay).filter((r): r is URL => !!r); -} - -export { getAuthorRelays }; diff --git a/src/query.ts b/src/query.ts deleted file mode 100644 index 4b4d062..0000000 --- a/src/query.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Filter } from '@/deps.ts'; - -function query(_filter: Filter, _relays?: URL[]) { - // TODO -} - -export { query };