Skip to content

v2.3.0

Compare
Choose a tag to compare
@nvie nvie released this 09 Jan 07:55
· 42 commits to main since this release

New features:

  • All enum types are now supported (docs)
  • Record decoder now supports both record(values) and record(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() and oneOf()

New decoders:

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 better set() 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() (prefer record())
  • hardcoded() (prefer always())
  • maybe() (prefer nullish())
  • mixed (prefer unknown)
  • numericBoolean()

Other changes:

  • Fix: positiveNumber and positiveInteger 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