Elegant validation library for type-safe input data (for TypeScript and Flow)
MIT License
Bot releases are visible (Hide)
Published by nvie over 3 years ago
tuple1
Published by nvie over 3 years ago
TypeScript types:
nonEmptyString
Published by nvie about 4 years ago
object()
, inexact()
, and exact()
decoders will no longer contain explicit undefined
values for optional keys, but instead those keys will be missing in the returned object entirely. (#574, thanks @w01fgang!)Published by nvie about 4 years ago
nonEmptyArray
and nonEmptyString
(for TypeScript)Published by nvie about 4 years ago
Published by nvie about 4 years ago
json
: decodes any valid JSON valuejsonObject
: decodes any valid JSON objectjsonArray
: decodes any valid JSON arrayPublished by nvie over 4 years ago
New decoders:
inexact()
: like object, but retain any extra fields on the input value as unknown
.object
, exact
, and inexact
.iso8601
: for decoding ISO8601-formatted date stringsImproved type inference for object()
and exact()
decoders (see #515, thanks @dimfeld)
DecoderType
is now an alias for $DecoderType
(to support both TypeScript and Flow conventional naming)
GuardType
(and $GuardType
) is a new type function to extract the type of a guard instance
Published by nvie over 4 years ago
Published by nvie over 4 years ago
Published by nvie over 4 years ago
Published by nvie over 4 years ago
Published by nvie over 4 years ago
Published by nvie over 4 years ago
Published by nvie over 4 years ago
Published by nvie over 4 years ago
New decoders:
tuple1
(thanksPublished by nvie over 4 years ago
exact_by_default=true
in debrief
dependencyPublished by nvie over 4 years ago
New decoders:
nonEmptyString
: like string
, but will fail on inputs with only whitespace
(or the empty string)
nonEmptyArray
: like array
, but will fail on inputs with 0 elements
Fixes:
exact_by_default=true
is enabledPublished by nvie almost 5 years ago
May cause breakage for Flow users:*
object()
and exact()
Flow type definitions that couldany
under rare circumstances.(*: For TypeScript users, this version is identical to v1.16.1.)