Order tag conditionals alphabetically, improve logic
This commit is contained in:
parent
48343c8035
commit
9cca801c80
|
@ -7,11 +7,12 @@ type TagCondition = ({ event, count }: { event: SignedEvent; count: number }) =>
|
||||||
|
|
||||||
/** Conditions for when to index certain tags. */
|
/** Conditions for when to index certain tags. */
|
||||||
const tagConditions: Record<string, TagCondition> = {
|
const tagConditions: Record<string, TagCondition> = {
|
||||||
't': ({ count }) => count < 5,
|
|
||||||
'p': ({ event }) => event.kind === 3,
|
|
||||||
'd': ({ event, count }) => 30000 <= event.kind && event.kind < 40000 && count === 0,
|
'd': ({ event, count }) => 30000 <= event.kind && event.kind < 40000 && count === 0,
|
||||||
'q': ({ event, count }) => event.kind === 1 && count === 0,
|
'e': ({ count }) => count < 15,
|
||||||
|
'p': ({ event, count }) => event.kind === 3 || count < 15,
|
||||||
'proxy': ({ count }) => count === 0,
|
'proxy': ({ count }) => count === 0,
|
||||||
|
'q': ({ event, count }) => event.kind === 1 && count === 0,
|
||||||
|
't': ({ count }) => count < 5,
|
||||||
};
|
};
|
||||||
|
|
||||||
function insertEvent(event: SignedEvent): Promise<void> {
|
function insertEvent(event: SignedEvent): Promise<void> {
|
||||||
|
|
Loading…
Reference in New Issue