Releases: nvie/decoders
Releases · nvie/decoders
v2.9.1
v2.9.0
Breaking!
- Rename
Decoder.then()→Decoder.chain()to avoid confusion with Promises (custom thenables)
New APIs:
- New:
sized(decoder, {min?, max?, size?})utility for adding length validation to strings, arrays, and sets. - New:
min(min, decoder?),max(max, decoder?), andbetween(min, max, decoder?)utilities for adding inclusive numeric range validation. The decoder defaults tonumberif omitted. - New:
urlStringdecoder, which is likeurl, but returns a string instead of a URL instance.
Changes:
- Rename date decoders for clarity:
iso8601→isoDate(iso8601will be kept as alias)dateString→isoDateString(deprecated, will be removed in 3.x)datelike→flexDate(deprecated, will be removed in 3.x)
- Cleaner error messages for
flexDateandurldecoders - Add missing top-level type exports for annotations
- Improve deeper tree-shaking support (thanks @EskiMojo14!)
v2.9.0-pre.5
Breaking!
- Rename
Decoder.then()→Decoder.chain()to avoid confusion with Promises (custom
thenables)
New APIs:
- New:
sized(decoder, {min?, max?, size?})utility for adding length validation to
strings, arrays, and sets. - New:
min(min, decoder?),max(max, decoder?), andbetween(min, max, decoder?)
utilities for adding inclusive numeric range validation. The decoder defaults to
numberif omitted. - New:
urlStringdecoder, which is likeurl, but returns a string instead of a URL
instance.
Changes:
- Rename date decoders for clarity:
iso8601→isoDate(iso8601will be kept as alias)dateString→isoDateString(deprecated, will be removed in 3.x)datelike→flexDate(deprecated, will be removed in 3.x)
- Cleaner error messages for
flexDateandurldecoders - Add missing top-level type exports for annotations
v2.8.0
- New:
anythingis now an alias forunknown, which might be more readable in some contexts - In error output, display promise, bigint, and any other unknown values (instead of '???')
- Export some internally used utilities are generally useful:
isDate(value)isDecoder(value)isPlainObject(value)isPromiseLike(value)
- Drop previously deprecated decoders:
dict()(preferrecord())hardcoded()(preferalways())maybe()(prefernullish())mixed(preferunknown)set()(prefersetFromArray())
- Drop support for Node 18 and below (they will likely still work, but are no longer tested)
- Export
isDecoder(value)helper