microFilterSchema: allow limit property

This commit is contained in:
Alex Gleason 2024-04-23 12:08:00 -05:00
parent 3557102b08
commit b1309c4ec3
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -40,8 +40,12 @@ function getMicroFilters(event: NostrEvent): MicroFilter[] {
/** Microfilter schema. */ /** Microfilter schema. */
const microFilterSchema = z.union([ const microFilterSchema = z.union([
z.object({ ids: z.tuple([nostrIdSchema]) }).strict(), z.object({ ids: z.tuple([nostrIdSchema]), limit: z.number().optional() }).strict(),
z.object({ kinds: z.tuple([z.literal(0)]), authors: z.tuple([nostrIdSchema]) }).strict(), z.object({
kinds: z.tuple([z.literal(0)]),
authors: z.tuple([nostrIdSchema]),
limit: z.number().optional(),
}).strict(),
]); ]);
/** Checks whether the filter is a microfilter. */ /** Checks whether the filter is a microfilter. */