Array
Example
Section titled “Example”import * as p from '@vbudovski/paseri';
const schema = p.array(p.number());const data = [1, 2, 3];
const result = schema.safeParse(data);if (result.ok) { // result.value typed as `number[]`.}
Playground
Section titled “Playground”Validators
Section titled “Validators”Consists of at least length
elements.
p.array(p.number()).min(3);
Consists of at most length
elements.
p.array(p.number()).max(3);
length
Section titled “length”Consists of exactly length
elements.
p.array(p.number()).length(3);