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