Packages

yup

1.7.1 · 21 Sep 2025MIT16.7M / weekRepositorynpmAtom feed

Your version

0.31.0

23 Nov 2020Where it was published

0.32.11 is the newest release of 0.31.x.

In short

2 breaking1 deprecated3 new1 fixed

  • breaking

    array().required() will no longer consider an empty array missing and required checks will pass.

  • breaking

    Plain objects and arrays are no long cast to strings automatically

  • deprecated

    Deprecate the getter overload of default()

Release note

Bug Fixes

Features

  • Add array.length() and treat empty arrays as valid for required()

  • Add object.pick and object.omit

  • deprecated

    Deprecate the getter overload of default()

  • More strictly coerce strings, exclude arrays and plain objects

Breaking changes

  • breaking

    array().required() will no longer consider an empty array missing and required checks will pass.

To maintain the old behavior change to:

array().required().min(1)
  • breaking

    Plain objects and arrays are no long cast to strings automatically

to recreate the old behavior:

string().transform((_, input) => input != null && input.toString ? input.toString() : value);