mirror of
https://github.com/Cameri/nostream.git
synced 2025-03-18 05:41:49 +01:00
chore: allow filter with limit zero
Signed-off-by: Ricardo Arturo Cabral Mejía <me@ricardocabral.io>
This commit is contained in:
parent
bb63d60b8b
commit
efd4c00a8e
@ -8,5 +8,5 @@ export const filterSchema = Schema.object({
|
||||
kinds: Schema.array().items(kindSchema).max(20),
|
||||
since: Schema.number().min(0).multiple(1),
|
||||
until: Schema.number().min(0).multiple(1),
|
||||
limit: Schema.number().min(1).multiple(1).max(10000),
|
||||
limit: Schema.number().min(0).multiple(1).max(10000),
|
||||
}).pattern(/^#[a-z]$/, Schema.array().items(Schema.string().max(1024)).max(256))
|
||||
|
@ -69,7 +69,7 @@ describe('NIP-01', () => {
|
||||
],
|
||||
limit: [
|
||||
{ message: 'must be a number', transform: assocPath(['limit'], null) },
|
||||
{ message: 'must be greater than or equal to 1', transform: assocPath(['limit'], -1) },
|
||||
{ message: 'must be greater than or equal to 0', transform: assocPath(['limit'], -1) },
|
||||
{ message: 'must be a multiple of 1', transform: assocPath(['limit'], Math.PI) },
|
||||
{ message: 'must be less than or equal to 10000', transform: assocPath(['limit'], 10001) },
|
||||
],
|
||||
|
Loading…
x
Reference in New Issue
Block a user