CHANGELOG

Bug Fixes

Features

Bug Fixes

Features

BREAKING CHANGES

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

To maintain the old behavior change to:

  • plain objects and arrays are no long cast to strings automatically

to recreate the old behavior:

Bug Fixes

Features

Performance Improvements

BREAKING CHANGES

  • defined() now doesn't automatically allow null, this was a bug. to mimic the old behavior add nullable() to schema with defined()

Bug Fixes

Features

Bug Fixes

Features

Bug Fixes

Features

BREAKING CHANGES

  • For users of @types/yup only, no function changes but the type def change is large enough that it warranted a major bump here

Bug Fixes

Bug Fixes

Features

Bug Fixes

Bug Fixes

Features

BREAKING CHANGES

  • use Number.isInteger. This works correctly for large numbers.

Related to https://github.com/jquense/yup/pull/147

  • reach() no longer resolves the returned schema meaning it's conditions have not been processed yet; prefer validateAt/castAt where it makes sense

  • required no longer shows up twice in describe() output for array and strings, which also no longer override required

Bug Fixes

Features

BREAKING CHANGES

  • reach() no longer resolves the returned schema meaning it's conditions have not been processed yet; prefer validateAt/castAt where it makes sense

  • required no longer shows up twice in describe() output for array and strings, which also no longer override required

v0.26.3 - Tue, 28 Aug 2018 15:00:04 GMT

v0.26.0 - Fri, 20 Jul 2018 15:39:03 GMT

BREAKING CHANGES

  • locale number config properties less and more are now lessThan and moreThan

v0.25.1 - Wed, 16 May 2018 23:59:14 GMT

v0.25.0 - Tue, 15 May 2018 21:43:54 GMT

  • remove default export, there are only named exports now!

  • fix message defaults for built-in tests, default is only used for undefined messages

  • fix the describe() method so it works with nested schemas

v0.24.1 - Fri, 09 Feb 2018 19:09:02 GMT

v0.24.0 - Tue, 16 Jan 2018 14:44:32 GMT

v0.23.0 - Thu, 12 Oct 2017 17:08:47 GMT

** Probably not breaking but we are being safe about it **

** Features **

v0.22.1 - Thu, 12 Oct 2017 14:49:16 GMT

v0.22.0 - Sat, 26 Aug 2017 14:48:57 GMT

** Breaking **

** Fixes and Features

v0.21.3 - Wed, 18 Jan 2017 15:39:25 GMT

v0.21.2 - Fri, 09 Sep 2016 16:52:44 GMT

v0.21.1 - Mon, 29 Aug 2016 18:39:29 GMT

v0.21.0 - Mon, 29 Aug 2016 18:29:31 GMT

v0.20.0 - Wed, 20 Jul 2016 02:02:08 GMT

v0.19.1 - Mon, 18 Jul 2016 21:53:05 GMT

v0.19.0 - Fri, 24 Jun 2016 15:19:48 GMT

v0.18.3 - Mon, 09 May 2016 15:50:47 GMT

v0.18.2 - Mon, 25 Apr 2016 18:23:13 GMT

v0.18.1 - Mon, 25 Apr 2016 15:01:16 GMT

v0.18.0 - Sat, 23 Apr 2016 01:20:27 GMT

v0.17.6 - Thu, 21 Apr 2016 14:59:59 GMT

v0.17.5 - Thu, 21 Apr 2016 11:20:16 GMT

v0.17.4 - Wed, 20 Apr 2016 14:15:39 GMT

v0.17.3 - Tue, 19 Apr 2016 20:24:09 GMT

v0.17.2 - Tue, 19 Apr 2016 16:46:54 GMT

v0.17.1 - Thu, 14 Apr 2016 19:12:22 GMT

v0.17.0 - Thu, 14 Apr 2016 17:13:50 GMT

v0.16.5 - Tue, 12 Apr 2016 13:36:38 GMT

v0.16.4 - Sat, 09 Apr 2016 20:13:13 GMT

v0.16.3 - Thu, 07 Apr 2016 19:13:23 GMT

v0.16.2 - Thu, 07 Apr 2016 17:57:44 GMT

v0.16.1 - Tue, 05 Apr 2016 20:56:45 GMT

v0.16.0 - Tue, 05 Apr 2016 20:17:40 GMT

v0.15.0 - Tue, 29 Mar 2016 14:56:15 GMT

v0.14.2 - Tue, 29 Mar 2016 14:48:37 GMT

v0.14.1 - Tue, 16 Feb 2016 19:51:25 GMT

v0.14.0 - Mon, 08 Feb 2016 16:17:40 GMT

v0.13.0 - Mon, 01 Feb 2016 20:49:40 GMT

v0.12.0 - Tue, 12 Jan 2016 19:12:18 GMT

v0.11.0 - Sun, 08 Nov 2015 17:17:09 GMT

0.9.0

breaking

  • test functions are no longer passed path and context as arguments, Instead they are now values on this inside the test function.

  • test functions are longer called with the schema as their this value, use this.schema instead.

other changes

  • test functions are call with with a new context object, including, options, parent and createError for dynamically altering validation errors.

0.8.3

  • document stripUnknown

  • add recursive option

  • add noUnknown() test to objects

0.8.2

  • default for objects now adds keys for all fields, not just fields with non empty defaults

0.8.1

  • bug fix

0.8.0

breaking

  • test functions are now passed path and context values along with the field value. Only breaks if using the callback style of defining custom validations

0.7.0

breaking

  • the validation() method has been renamed to test() and has a new signature requiring a name argument

  • exclusive validations now trump the previous one instead of defering to it e.g: string().max(10).max(15) has a max of 15 instead of 10

other changes

  • expose advanced signature for custom validation tests, gives finer grained control over how tests are added

  • added the abortEarly (default: true) option

  • transforms are passed an addition parameter: 'originalValue' you allow recovering from a bad transform further up the chain (provided no one mutated the value)

0.6.3

  • fix concat() method and add tests

0.6.2

  • fix validations where nullable fields were failing due to null values e.g string.max()

0.6.1

  • fix export error

0.6.0

breaking

  • Removed the extend and create methods. Use whatever javascript inheritance patterns you want instead.

  • the resolution order of defaults and coercions has changed. as well as the general handling of null values.

    • Number: null will coerce to false when nullable() is not specified. NaN values will now fail isType() checks

    • String: null will coerce to '' when nullable() is not specified

    • Date: Invalid dates will not be coerced to null, but left as invalid date, This is probably not a problem for anyone as invalid dates will also fail isType() checks

  • default values are cloned everytime they are returned, so it is impossible to share references to defaults across schemas. No one should be doing that anyway

  • stopped pretending that using schemas as conditions in when() actually worked (it didn't)

other changes

  • transform() now passes the original value to each transformer. Allowing you to recover from a bad transform.

  • added the equals() alias for oneOf

0.5.0

breaking

  • isValid is now async, provide a node style callback, or use the promise the method returns to read the validity. This change allows for more robust validations, specifically remote ones for client code (or db queries for server code). The cast method is still, and will remain, synchronous.

other changes

  • added validate method (also async) which resolves to the value, and rejects with a new ValidationError

Last updated