Repository URL to install this package:
|
Version:
1.1.0-1 ▾
|
concat doesn't check for "unset" nullable or presence when merging meaning the nullability and presence will always be the same as the schema passed to concat(). They can be overridden if needed after concatenationimport { StringSchema, string } from 'yup'default() (#1119) (5dae837)To maintain the old behavior change to:
array().required().min(1)
to recreate the old behavior:
string().transform((_, input) => input != null && input.toString ? input.toString() : value);
@types/yup only, no function changes but the type def change is large enough that it warranted a major bump heremixed method to control required behavior (#459) (5b01f18)optional() and unknown() (#460) (51e8661)Related to https://github.com/jquense/yup/pull/147
mixed method to control required behavior (#459) (5b01f18)optional() and unknown() (#460) (51e8661)number config properties less and more are now lessThan and moreThanundefined messagesdescribe() method so it works with nested schemas** Probably not breaking but we are being safe about it **
** Features **
** Breaking **
** Fixes and Features
frombreaking
test functions are no longer passed path and context as arguments, Instead they are now values on this inside the test function.this value, use this.schema instead.other changes
createError for dynamically altering validation errors.stripUnknownrecursive optionnoUnknown() test to objectsbreaking
test functions are now passed path and context values along with the field value. Only breaks if using the callback style of defining custom validationsbreaking
validation() method has been renamed to test() and has a new signature requiring a name argumentstring().max(10).max(15) has a max of 15 instead of 10other changes
abortEarly (default: true) optionconcat() method and add testsnull values e.g string.max()breaking
extend and create methods. Use whatever javascript inheritance patterns you want instead.null values.
null will coerce to false when nullable() is not specified. NaN values will now fail isType() checksnull will coerce to '' when nullable() is not specifiednull, but left as invalid date, This is probably not a problem for anyone as invalid dates will also fail isType() checkswhen() actually worked (it didn't)other changes
transform() now passes the original value to each transformer. Allowing you to recover from a bad transform.equals() alias for oneOfbreaking
other changes