Module
The modular and type safe schema library for validating structural data 🤖
Extremely Popular
Changelog
All notable changes to the library will be documented in this file.
v0.22.0 (December 03, 2023)
- Add support for boolean to
notValue
validation (pull request #261) - Add
.typed
to schema validation result and execute pipeline of complex schemas if output is typed (issue #76, #145) - Add
forward
method that forwards issues of pipelines to nested fields (issue #76, #145) - Rename and change util functions and refactor codebase
- Fix
RecordInput
andRecordOuput
type when usingunionAsync
as key - Fix output type for
nullable
,nullableAsync
,nullish
,nullishAsync
,optional
andoptionalAsync
when using a default value (issue #271)
v0.21.0 (November 19, 2023)
- Change structure of schemas, validations and transformations to make properties accessible (pull request #211)
- Fix errors in JSDoc comments and add JSDoc ESLint plugin (pull request #205)
- Fix missing file extension for Deno (pull request #249)
v0.20.1 (November 2, 2023)
- Remove
never
from type signatur of strict objects and tuples (issue #234)
v0.20.0 (October 31, 2023)
Note: The library has been revised and refactored. There is a migration guide in the release notes.
- 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
v0.19.0 (October 08, 2023)
- Add
notBytes
,notLength
,notSize
andnotValue
validation function (pull request #194) - Add support for unions as key of
record
andrecordAsync
schema (issue #201) - Add support for pipeline validation to
transform
andtransformAsync
(issue #197) - Change regex of
email
validation to improve performance and security (pull request #180) - Change
object
andobjectAsync
schema to exclude non-existing keys (issue #199) - Fix types at
brand
,transform
andunwrap
method (issue #195) - Deprecate
equal
validation function in favor ofvalue
(issue #192)
v0.18.0 (September 30, 2023)
- Add
intersection
andintersectionAsync
schema (pull request #117) - Fix
RecordInput
andRecordOutput
type (pull request #184) - Change
RecordSchema
andRecordSchemaAsync
type - Change
flatten
function and improve types
v0.17.1 (September 25, 2023)
- Fix missing file extensions for Deno (pull request #178, #181)
v0.17.0 (September 17, 2023)
- Add support for multiple branding of a value (pull request #88)
- Add support for dynamic error messages via functions (pull request #136)
- Add
skipPipe
option to skip execution of pipelines (pull request #164)
v0.16.0 (September 16, 2023)
- Add
ulid
validation (pull request #151) - Add
getIssues
,getOutput
andgetPipeIssues
util and refactor code - Fix type check in
number
andnumberAsync
schema (issue #157) - Change
PipeResult
type to allow multiple issues (issue #161) - Rename previous
getIssues
util togetSchemaIssues
v0.15.0 (September 10, 2023)
- Add possibility to define path of pipeline issue (issue #5)
- Add
getDefault
method to get default value of schema (issue #105) - Add support for enums as key of
record
andrecordAsync
schema (issue #134) - Add support for default values to
optional
,optionalAsync
,nullable
,nullableAsync
,nullish
andnullishAsync
schema (issue #96, #118) - Deprecate
withDefault
method in favor ofoptional
schema
v0.14.0 (September 08, 2023)
- Add
cuid2
validation (pull request #130) - Add
passthrough
,passthroughAsync
,strip
andstripAsync
method - Add
InstanceSchemaAsync
overload totransformAsync
method (pull request #138) - Fix bug in
strict
andstrictAsync
method for optional keys (issue #131)
v0.13.1 (August 23, 2023)
- Change object type check in
object
andrecord
schema
v0.13.0 (August 23, 2023)
Note: The library has been revised and refactored. There is a migration guide in the release notes.
- Add
fallback
andfallbackAsync
method (pull request #103) - Add
excludes
validation as negation ofincludes
- Add support for more primitives to
literal
schema (pull request #102) - Add support for dynamic values to
withDefault
method - Change
flatten
function so that issues are also accepted as argument - Change return type of
safeParse
andsafeParseAsync
method - Change error handling and refactor library to improve performance
- Rename
.parse
to._parse
and.types
to._types
to mark it as internal
v0.12.0 (August 11, 2023)
- Change input type of
mimeType
validation toBlob
- Rename
useDefault
method towithDefault
(issue #80) - Add
brand
method to support branded types (pull request #85)
v0.11.1 (August 07, 2023)
- Fix types of
enumType
andenumTypeAsync
schema (issue #70) - Improve performance of loops with for…of (pull request #68)
v0.11.0 (August 06, 2023)
- Fix prototype pollution vulnerability of
record
andrecordAsync
(pull request #67) - Add
finite
,safeInteger
andmultipleOf
validation (pull request #64, #65, #66)
v0.10.0 (August 05, 2023)
- Add
integer
validation (pull request #62)
v0.9.0 (August 04, 2023)
- Add
imei
validation andisLuhnAlgo
util (pull request #37) - Fix
isoDateTime
,isoTime
,isoTimeSecond
andisoTimestamp
validation (pull request #42)
v0.8.0 (July 31, 2023)
- Fix infered
object
andrecord
types (issue #9, #10, #34) - Add
strict
andstrictAsync
method to detect unknown object keys
v0.7.0 (July 30, 2023)
- Add
is
method which can be used as a type guard (pull request #13) - Throw all validation issues of a pipeline by default (issue #18)
- Add
abortPipeEarly
option to abort pipe on first error (issue #18) - Add
abortEarly
option to abort on first error
v0.6.0 (July 30, 2023)
- Add
toMinValue
andtoMaxValue
transformation
v0.5.0 (July 28, 2023)
- Fix invalid
comparable
import when using Deno - Add util functions to exports of library
- Rename
minRange
andmaxRange
tominValue
andmaxValue
(issue #20) - Add
value
validation function
v0.4.0 (July 27, 2023)
- Add
instance
andinstanceAsync
schema - Refactor library to work with Deno
v0.3.0 (July 27, 2023)
- Add
bytes
,minBytes
andmaxBytes
validation (pull request #1) - Change build step to tsup and exports in package.json (issue #7)
v0.2.1 (July 26, 2023)
- Change order of exports in package.json (issue #7)
v0.2.0 (July 25, 2023)
- Add
blob
andblobAsync
schema
v0.1.0 (July 12, 2023)
- Initial release