Merge branch 'master' of github.com:trouble/payload into slate-js

This commit is contained in:
Jarrod Flesch
2020-06-04 15:14:35 -04:00
46 changed files with 820 additions and 336 deletions

View File

@@ -27,7 +27,11 @@ const optionsToValidatorMap = {
return `This value must be longer than the minimum length of ${options.max} characters.`;
}
return Boolean(value);
if (typeof value !== 'string' || value.length === 0) {
return 'This field is required.';
}
return true;
},
password: (value, options = {}) => {
if (options.maxLength && value.length > options.maxLength) {