3 ms·
The difference between parse and validate is function parse(x: Foo): Bar { ... } const y = parse(x); and function validate(x: Foo): void { ... }
by remexre 1y ago
The difference between parse and validate is
function parse(x: Foo): Bar { ... }
const y = parse(x);
and
function validate(x: Foo): void { ... }
validate(x);
const y = x as Bar;
Zod has a parser API, not a validator API.