Skip to content

Commit efd4c00

Browse files
committed
chore: allow filter with limit zero
Signed-off-by: Ricardo Arturo Cabral Mejía <me@ricardocabral.io>
1 parent bb63d60 commit efd4c00

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/schemas/filter-schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ export const filterSchema = Schema.object({
88
kinds: Schema.array().items(kindSchema).max(20),
99
since: Schema.number().min(0).multiple(1),
1010
until: Schema.number().min(0).multiple(1),
11-
limit: Schema.number().min(1).multiple(1).max(10000),
11+
limit: Schema.number().min(0).multiple(1).max(10000),
1212
}).pattern(/^#[a-z]$/, Schema.array().items(Schema.string().max(1024)).max(256))

test/unit/schemas/filter-schema.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ describe('NIP-01', () => {
6969
],
7070
limit: [
7171
{ message: 'must be a number', transform: assocPath(['limit'], null) },
72-
{ message: 'must be greater than or equal to 1', transform: assocPath(['limit'], -1) },
72+
{ message: 'must be greater than or equal to 0', transform: assocPath(['limit'], -1) },
7373
{ message: 'must be a multiple of 1', transform: assocPath(['limit'], Math.PI) },
7474
{ message: 'must be less than or equal to 10000', transform: assocPath(['limit'], 10001) },
7575
],

0 commit comments

Comments
 (0)