v2.3.0
New features:
- All
enum
types are now supported (docs) - Record decoder now supports both
record(values)
andrecord(keys, values)
forms (docs) - Add
datelike
decoder (docs) - Add support for
bigint
(docs) - Add built-in support for common string validations
- Better support for symbols in
constant()
andoneOf()
New decoders:
enum_
(see docs)record()
(see docs)select()
(see docs)bigint
(see docs)datelike
(see docs)decimal
(see docs)hexadecimal
(see docs)numeric
(see docs)
Renamed decoders:
Some decoders have been renamed because their names were based on Flowisms. Names have been updated to better reflect TypeScript terminology:
dict()
→record()
maybe()
→nullish()
set()
→setFromArray()
(to make room for a betterset()
decoder in a future
version)
Deprecated decoders:
The following decoders are deprecated because they were not commonly used, and a bit too specific to be in the standard library. They are also scheduled for removal in a future decoders version.
dict()
(preferrecord()
)hardcoded()
(preferalways()
)maybe()
(prefernullish()
)mixed
(preferunknown
)numericBoolean()
Other changes:
- Fix:
positiveNumber
andpositiveInteger
no longer accept-0
as valid inputs - Fix:
either
return type would sometimes get inferred incorrectly if members partially overlapped (see #941) - Reorganized internal module structure
- Simplified some of the more complicated internal types