Skip to content

Commit

Permalink
Fix linter violation
Browse files Browse the repository at this point in the history
  • Loading branch information
navzam committed Dec 3, 2024
1 parent 4a80f21 commit 1b23b61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util/Validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export namespace Validators {
return value.length >= length;
case Types.Email:
return /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(value);
case Types.Date:
case Types.Date: {
// Ensure it matches the expected format
const regexRes = /^(0[1-9]|1[012])(?:\/|-)(0[1-9]|[12][0-9]|3[01])(?:\/|-)((?:19|20)\d{2})$/.exec(value);
if (regexRes === null) return false;
Expand All @@ -163,7 +163,7 @@ export namespace Validators {
dateObj.getUTCFullYear() === y &&
(dateObj.getUTCMonth() + 1) === m &&
dateObj.getUTCDate() === d;

}
default:
return false;
}
Expand Down

0 comments on commit 1b23b61

Please sign in to comment.