Skip to content

Commit 9590945

Browse files
committed
chore: update version to 2.8.0-beta3 in package.json and improve CNPJ validation logic
1 parent da3da66 commit 9590945

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "multiform-validator",
3-
"version": "2.8.0-beta2",
3+
"version": "2.8.0-beta3",
44
"description": "Javascript library made to validate, several form fields, such as: email, images, phone, password, cpf etc.",
55
"main": "./dist/index.js",
66
"types": "./types/index.d.ts",

src/cnpjValidator/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ function cnpjIsValid(
3333
return cnpjIsValid2(cnpj, errorMsg);
3434
}
3535

36-
const isOnlyNumbers: boolean = /^\d+$/.test(cnpj.replace(/\D/g, ""));
36+
const isCnpjOnlyNumbers: boolean = /^\d+$/.test(cnpj);
3737

38-
if (isOnlyNumbers) {
39-
return cnpjIsValid1(cnpj, errorMsg);
38+
if (isCnpjOnlyNumbers) {
39+
return cnpjIsValid2(cnpj, errorMsg);
4040
}
4141

42-
return cnpjIsValid2(cnpj, errorMsg);
42+
return cnpjIsValid1(cnpj, errorMsg);
4343
}
4444

4545
export default cnpjIsValid;

0 commit comments

Comments
 (0)