Parsing a value to match the schema. This is different to validation because it returns a new value.
import * as v from "valibot";
import { personSchema } from "./schemas";
const person = v.parse(personSchema, data);
// person is of type Person
| Library | Version | Optimizations | Error type | Mean | Compare | |||
|---|---|---|---|---|---|---|---|---|
valibot (abortPipeEarly only) | Code snippet | 1.1.0 | None | Abort early | 12 μs | |||
valibot | Code snippet | 1.1.0 | None | Abort early | 12 μs | 1x | ||
effect | Code snippet(Commented code is not benchmarked) | 3.19.3 | None | Abort early | 18 μs | 1.5x | ||
joi | Code snippet | 18.0.1 | None | Abort early | 36 μs | 2.98x | ||
yup | Code snippet | 1.7.1 | None | Abort early | 143 μs | 11.71x |