Validators
From regular expressions to Valibot
The first move was email
(#1163). A
single EMAIL_REGEX became a Valibot schema that trims, lowercases,
checks and brands the value. A function that takes a ValidEmail
can only receive an address that passed the check.
The next day the rest followed, one small pull request each:
- Slugs moved to Valibot's
v.slug()(#1171). - Dates in
YYYY-MM-DDform had a home-made regex in four places, each a little different. All four became oneisIsoDatehelper on Valibot'sisoDate(#1172). The old\d{2}pattern accepted2026-99-99. The new one does not. - Case conversion for database column names moved to
toCamelCaseandtoSnakeCase. The email provider guard became apicklist(#1173). - Tests check API responses with a
strictObjectschema (#1178). One parse replaced seventeen "does not expose this field" assertions.
Today more than a hundred files under src/ import Valibot.