Many thanks to @WtfJoke, @dboune, @alexabw and @aypotu for contributing to this release.
- Improve performance of
enum_
andenumAsync
schema by caching values - Change ISO timestamp regex to support timestamps with lower and higher millisecond accuracy (pull request #353)
- Change issue handling of
union
,unionAsync
,variant
andvariantAsync
schema to improve developer experience - Fix bug in
getDefaults
,getDefaultsAsync
,getFallbacks
andgetFallbacksAsync
schema for falsy but notundefined
values (issue #356) - Fix type of
pipe
argument atunion
,unionAsync
,variant
andvariantAsync
schema - Fix bug that broke pipeline execution in
union
,unionAsync
,variant
andvariantAsync
schema (issue #364) - Fix typo in type name of
startsWith
validation action (pull request #375)
Migration guide
The changes in union
, unionAsync
, variant
and variantAsync
are breaking changes and may result in different behavior when returning issues. Please create an issue if you have questions about this.
import * as v from 'valibot';
// Change this
const UnionSchema = v.union(
[v.string([v.email()]), v.literal('')],
'Not a valid email'
);
// To that
const UnionSchema = v.union([
v.string([v.email('Not a valid email')]),
v.literal(''),
]);