Skip to content

Commit

Permalink
rewrite to use if
Browse files Browse the repository at this point in the history
  • Loading branch information
langz committed Oct 8, 2024
1 parent 1ce7fe7 commit 2892d92
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,10 @@ function NationalIdentityNumber(props: Props) {
(value: string) => {
const validationPattern = '^[4-9].*' // 1st num is increased by 4. i.e, if 01.01.1985, D number would be 410185.

return (
(new RegExp(validationPattern).test(value) &&
dnrValidator(value)) ||
fnrValidator(value)
)
if (new RegExp(validationPattern).test(value)) {
return dnrValidator(value)
}
return fnrValidator(value)
},
[dnrValidator, fnrValidator]
)
Expand Down

0 comments on commit 2892d92

Please sign in to comment.