Hacker News new | ask | show | jobs
by remexre 285 days 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.