Skip to content

Commit

Permalink
New release
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno Oliveira committed Feb 8, 2018
1 parent ea9c2d2 commit 3870048
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "br-masks",
"version": "0.5.0",
"version": "0.5.1",
"description": "A library of masks applicable to several Brazilian data like I.E., CNPJ, CPF and others",
"id": "/br-masks",
"main": "releases/br-masks.js",
Expand Down
10 changes: 5 additions & 5 deletions releases/br-masks.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var CEP = function(value) {
if(!value) {
return value;
}
var processed = cepMask.process(value);
var processed = cepMask.process(value.replace(/\D/g, ''));
return processed.result;
};

Expand All @@ -40,7 +40,7 @@ var CNPJBASE = function(value) {
return value;
}
var cnpjBasePattern = new StringMask('00.000.000');
var formatedValue = cnpjBasePattern.apply(value);
var formatedValue = cnpjBasePattern.apply(value.replace(/\D/g, ''));
return formatedValue;
};

Expand All @@ -50,7 +50,7 @@ var CNPJ = function(value) {
return value;
}
var cnpjPattern = new StringMask('00.000.000\/0000-00');
var formatedValue = cnpjPattern.apply(value);
var formatedValue = cnpjPattern.apply(value.replace(/\D/g, ''));
return formatedValue;
};

Expand All @@ -72,7 +72,7 @@ var CPF = function(value) {
if(!value) {
return value;
}
var formatedValue = cpfPattern.apply(value);
var formatedValue = cpfPattern.apply(value.replace(/\D/g, ''));
return formatedValue;
};

Expand Down Expand Up @@ -194,7 +194,7 @@ var PHONE = function(value) {
}

var formatedValue;
value = value + '';
value = value.replace(/\D/g, '') + '';
if (value.indexOf('0800') === 0) {
formatedValue = phoneMask0800.apply(value);
}else if(value.length < 11){
Expand Down
2 changes: 1 addition & 1 deletion releases/br-masks.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3870048

Please sign in to comment.