Many thanks to @lo1tuma, @Karakatiza666, @naveen-bharathi, @jsudelko, @danielo515, @iamriajul, @brandonpittman, @marek-hanzal, @kurtextrem, @BThomann, @hermanseder, @sillvva, @tjenkinson and many more peoples for contributing to this release.
- Add
getRestAndDefaultArgs
utility function - Add
rest
argument toobject
andobjectAsync
schema - Add
variant
andvariantAsync
schema (issue #90, #216) - Add
getFallback
property to schema infallback
method (pull request #177) - Add
PartialObjectEntries
andPartialObjectEntriesAsync
type (issue #217) - Add export for any validation regex (pull request #219)
- Add
getDefaultAsync
,getDefaults
andgetDefaultsAsync
,getFallback
,getFallbackAsync
,getFallbacks
,getFallbacksAsync
method (issue #155) - Add support for schema validation to
transform
andtransformAsync
- Fix type check in
date
anddateAsync
for invalid dates (pull request #214) - Improve security of regular expressions (pull request #202)
- Improve
optional
,optionalAsync
,nullable
,nullableAsync
,nullish
andnullishAsync
schema - Change
ObjectSchema
andObjectSchemaAsync
type - Change type check in
tuple
andtupleAsync
to be less strict - Change return type of
action
argument incoerce
andcoerceAsync
tounknown
- Change type of
brand
,getDefault
,transform
andtransformAsync
method - Change type of
array
,arrayAsync
,intersection
,intersectionAsync
,map
,mapAsync
,object
,objectAsync
,union
,unionAsync
,record
,recordAsync
,set
,setAsync
,tuple
andtupleAsync
schema - Rename
schema
property of every schema type totype
- Rename
intersection
andintersectionAsync
schema tointersect
andintersectAsync
- Rename
enumType
andenumTypeAsync
schema topicklist
andpicklistAsync
- Rename
nativeEnum
andnativeEnumAsync
schema toenum_
andenumAsync
- Rename
nullType
andnullTypeAsync
schema tonull_
andnullAsync
- Rename
undefinedType
andundefinedTypeAsync
schema toundefined_
andundefinedAsync
- Rename
voidType
andvoidTypeAsync
schema tovoid_
andvoidAsync
- Rename
default
property ofoptional
,optionalAsync
,nullable
,nullableAsync
,nullish
andnullishAsync
schema togetDefault
- Rename
ObjectShape
andObjectShapeAsync
types toObjectEntries
andObjectEntriesAsync
- Rename
TupleShape
andTupleShapeAsync
types toTupleItems
andTupleItemsAsync
- Deprecate
passthrough
,strict
andstrip
method in favor ofobject
schema withrest
argument
Migration guide
Unfortunately, I haven't had time to write a migration guide yet. If you have any questions or problems, please have a look at the source code or create an issue. I usually respond within 24 hours.