mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-20 13:54:31 +01:00
Make EventsDB not rely on Conf
This commit is contained in:
@@ -13,7 +13,7 @@ import { RelayError } from '@/RelayError.ts';
|
||||
import { AdminSigner } from '@/signers/AdminSigner.ts';
|
||||
import { Storages } from '@/storages.ts';
|
||||
import { nostrNow } from '@/utils.ts';
|
||||
import { purifyEvent } from '@/storages/hydrate.ts';
|
||||
import { purifyEvent } from '@/utils/purify.ts';
|
||||
|
||||
const debug = Debug('ditto:api');
|
||||
|
||||
|
||||
14
src/utils/purify.ts
Normal file
14
src/utils/purify.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { NostrEvent } from '@nostrify/nostrify';
|
||||
|
||||
/** Return a normalized event without any non-standard keys. */
|
||||
export function purifyEvent(event: NostrEvent): NostrEvent {
|
||||
return {
|
||||
id: event.id,
|
||||
pubkey: event.pubkey,
|
||||
kind: event.kind,
|
||||
content: event.content,
|
||||
tags: event.tags,
|
||||
sig: event.sig,
|
||||
created_at: event.created_at,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user