Skip to content

Commit

Permalink
fix: minLength field validation error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
denolfe committed Jan 17, 2021
1 parent 2c98087 commit 5e60b86
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/fields/validations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const text: Validate = (value: string, options = {}) => {
}

if (options.minLength && (value && value.length < options.minLength)) {
return `This value must be longer than the minimum length of ${options.maxLength} characters.`;
return `This value must be longer than the minimum length of ${options.minLength} characters.`;
}

if (options.required) {
Expand All @@ -49,7 +49,7 @@ export const password: Validate = (value: string, options = {}) => {
}

if (options.minLength && value.length < options.minLength) {
return `This value must be longer than the minimum length of ${options.maxLength} characters.`;
return `This value must be longer than the minimum length of ${options.minLength} characters.`;
}

if (options.required && !value) {
Expand All @@ -74,7 +74,7 @@ export const textarea: Validate = (value: string, options = {}) => {
}

if (options.minLength && value.length < options.minLength) {
return `This value must be longer than the minimum length of ${options.maxLength} characters.`;
return `This value must be longer than the minimum length of ${options.minLength} characters.`;
}

if (options.required && !value) {
Expand Down

0 comments on commit 5e60b86

Please sign in to comment.