Skip to content

Releases: badrap/valita

v0.4.6

01 Aug 14:38
5ea3ae3

Choose a tag to compare

Patch Changes

  • 7c42103 Thanks @jviide! - Publish npm packages using trusted publishing

v0.4.5

20 May 00:47
985ac6a

Choose a tag to compare

Patch Changes

  • d312e6d Thanks @jviide! - feat: always normalize custom errors

    Custom errors listed in issue lists (ValitaError.issue and ValitaResult.issue) are now always normalized to match the type { code: "custom_error", path: (string | number)[], message?: string | undefined }.

  • e66a42e Thanks @jviide! - Allow passing a type to .chain()

    The .chain() method of types now accepts other types as-is:

    v.string() // Accept strings as input,
      .map((s) => Number(s)) // then parse the strings to numbers,
      .chain(v.literal(1)); // and ensure that the parsed number is 1.

    The parsing mode is propagated to the chained type:

    const example = v.unknown().parse(v.object({ a: v.number() }));
    
    example.parse({ a: 1, b: 2 }, { mode: "strip" });
    // { a: 1 }

v0.4.4

15 Apr 15:42
d03ed73

Choose a tag to compare

Patch Changes

  • b9d9c30 Thanks @jviide! - Add support for .nullable(() => x)

    The .nullable() method now supports default value functions_similarly to .optional().

v0.4.3

07 Mar 19:03
0e5bebb

Choose a tag to compare

Patch Changes

v0.4.2

03 Dec 23:11
4491dcf

Choose a tag to compare

Patch Changes

  • c648586 Thanks @jviide! - Include an array of sub-issues in "invalid_union" issues

v0.4.1

02 Dec 12:35
7e35c43

Choose a tag to compare

Patch Changes

v0.4.0

02 Dec 11:26
ce1ca8e

Choose a tag to compare

Minor Changes

v0.3.16

02 Dec 11:07
3c2c73b

Choose a tag to compare

Patch Changes

  • 59b89be Thanks @arv for reporting this! - Revert changes since v0.3.12 as they were backwards incompatible

v0.3.15

01 Dec 00:42
8a62937

Choose a tag to compare

Patch Changes

v0.3.12

25 Nov 21:51
f5491e4

Choose a tag to compare

Patch Changes

  • 8aaad50 Thanks @jviide! - Mark .optional(() => ...) as non-experimental and recommend it over the now-deprecated .default(x)