Skip to content

Releases: badrap/valita

v0.3.11

16 Oct 23:06
fdae912
Compare
Choose a tag to compare

Patch Changes

  • f78c082 Thanks @jviide! - Add experimental support for .optional(() => x)

    The .optional() method now supports default value functions for replacing undefined and missing values from the input and wrapped validator. The functionality is similar to .default(x), except that defaultFn has to be a function and is executed for each validation run. This allows patterns like the following:

    const Item = v.object({ id: v.string() });
    
    const Items = v.array(Item).optional(() => []);

    This avoids a common pitfall with using .default([]) for the same pattern. As the newly created empty arrays are not shared, mutating them is safe(r) as it doesn't affect other validation outputs.

    This feature is marked experimental for the time being.

v0.3.10

14 Oct 15:12
5b9d29c
Compare
Choose a tag to compare

Patch Changes

  • 43513b6 Thanks @jviide! - Add support for variadic tuple types

    Tuple and array types now have a new method, .concat() that can be used to create variadic tuple types.

  • 43513b6 Thanks @jviide! - Make v.array() a shorthand for v.array(v.unknown())

v0.3.9

16 Jul 23:42
6f980c9
Compare
Choose a tag to compare

Patch Changes

v0.3.8

20 Mar 15:41
824f868
Compare
Choose a tag to compare

Patch Changes

  • d2f85db Thanks @jviide! - Fix release automation, name scripts bump/release instead of version/publish

v0.3.6

02 Mar 18:38
Compare
Choose a tag to compare
  • Generate provenance statements for npm.
  • Functions passed to .chain(...), .map(...) and .assert(...) now receive a second parameter, useful for forwarding the current parsing mode to .try(...).

v0.3.5

01 Mar 14:46
Compare
Choose a tag to compare

v0.3.4

29 Feb 16:22
Compare
Choose a tag to compare
  • Add more docstrings.

v0.3.3

29 Feb 15:50
Compare
Choose a tag to compare
  • Add rudimentary docstrings to some exports.

v0.3.2

29 Feb 14:43
Compare
Choose a tag to compare

Full Changelog: v0.3.1...v0.3.2

v0.3.1

29 Feb 14:33
Compare
Choose a tag to compare
  • Add required files for JSR.