This codemod automatically migrates your Valibot codebase to version 0.31.0, handling all breaking changes introduced in this release.
What it migrates
- Schema renames:
custom→check,Input→InferInput,Output→InferOutput - Object merging:
merge→object - Objects/tuples with rest: Transforms
objectWithRestandtupleWithRestto new syntax - Loose/strict variants: Converts
looseObject/strictObjectandlooseTuple/strictTupleto new API - Pipeline API: Migrates array-based pipelines to
pipe()function calls - Method transformations: Updates
coerce,flatten,brand, andtransformmethod calls - Nested pipes: Flattens deeply nested schema compositions into cleaner
pipe()chains
Example
Before (v0.30):
typescriptconst schema = v.brand( v.transform( v.string([v.trim()]), (s) => s.toLowerCase() ), 'ProcessedString' );
After (v0.31):
typescriptconst schema = pipe( string(), transform((s) => s.trim()), transform((s) => s.toLowerCase()), brand('ProcessedString') );
License
MIT