From b1309c4ec31a2ea156ac0f4e40bd8a3d2474735f Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 23 Apr 2024 12:08:00 -0500 Subject: [PATCH] microFilterSchema: allow limit property --- src/filter.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/filter.ts b/src/filter.ts index 7dc75233..637e608a 100644 --- a/src/filter.ts +++ b/src/filter.ts @@ -40,8 +40,12 @@ function getMicroFilters(event: NostrEvent): MicroFilter[] { /** Microfilter schema. */ const microFilterSchema = z.union([ - z.object({ ids: z.tuple([nostrIdSchema]) }).strict(), - z.object({ kinds: z.tuple([z.literal(0)]), authors: 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]), + limit: z.number().optional(), + }).strict(), ]); /** Checks whether the filter is a microfilter. */