Skip to content

Commit

Permalink
Update cpfValidator.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel-logan authored Jun 14, 2024
1 parent 4f6aca2 commit d383ac7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/typescript/src/cpfValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ function cpfIsValid(

const cpfClean: string = cpf.replace(/\D+/g, "");

if (/^(\d)\1{10}$/.test(cpfLimpo)) {
if (/^(\d)\1{10}$/.test(cpfClean)) {
return {
isValid: false,
errorMsg: getErrorMessage(2),
};
}

if (cpfLimpo.length !== 11) {
if (cpfClean.length !== 11) {
return {
isValid: false,
errorMsg: getErrorMessage(1),
Expand Down

0 comments on commit d383ac7

Please sign in to comment.