Skip to content

Commit

Permalink
chore: v0.5.0
Browse files Browse the repository at this point in the history
closes #7 and closes #8
  • Loading branch information
the-darc committed Nov 9, 2016
1 parent 445c2b7 commit 7d47cf9
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 12 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
<a name="0.5.0"></a>
# [0.5.0](https://github.com/the-darc/br-masks/compare/0.4.1...0.5.0) (2016-11-09)


### Features

* **phone:** added support for 0800 phone numbers ([8fb2f46](https://github.com/the-darc/br-masks/commit/8fb2f46)), closes [#8](https://github.com/the-darc/br-masks/pull/8)
* **cnpj-base:** added support for cnpj-base.js ([5cc07ff](https://github.com/the-darc/br-masks/commit/5cc07ff)), closes [#7](https://github.com/the-darc/br-masks/pull/7)


<a name"0.4.1"></a>
### 0.4.1 (2015-09-01)

Expand Down
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "br-masks",
"version": "0.4.1",
"version": "0.5.0",
"description": "A library of masks applicable to several Brazilian data like I.E., CNPJ, CPF and others",
"homepage": "http://github.com/the-darc/br-masks",
"repository": {
Expand Down Expand Up @@ -33,6 +33,6 @@
"package.json"
],
"dependencies": {
"string-mask": "^0.2.1"
"string-mask": "^0.3.0"
}
}
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.4.1",
"version": "0.5.0",
"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
15 changes: 9 additions & 6 deletions releases/br-masks-standalone.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@
}

StringMask.prototype.process = function proccess(value) {
if (!value) {
return {result: '', valid: false};
}
if (!value) return '';
value = value + '';
var pattern2 = this.pattern;
var valid = true;
Expand Down Expand Up @@ -196,11 +194,12 @@
/**
* br-masks
* A library of masks applicable to several Brazilian data like I.E., CNPJ, CPF and others
* @version v0.4.1
* @version v0.5.0
* @link http://github.com/the-darc/br-masks
* @license MIT
*/
(function (root, factory) {
/* istanbul ignore next */
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['string-mask'], factory);
Expand All @@ -214,6 +213,7 @@
root.BrM = factory(root.StringMask);
}
}(this, function (StringMask) {
/* istanbul ignore if */
if (!StringMask) {
throw new Error('StringMask not found');
}
Expand Down Expand Up @@ -379,15 +379,18 @@ var NFEACCESSKEY = function(value) {
/*exported PHONE */
var PHONE = function(value) {
var phoneMask8D = new StringMask('(00) 0000-0000'),
phoneMask9D = new StringMask('(00) 00000-0000');
phoneMask9D = new StringMask('(00) 00000-0000'),
phoneMask0800 = new StringMask('0000-000-0000');

if(!value) {
return value;
}

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

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

4 changes: 3 additions & 1 deletion releases/br-masks.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/**
* br-masks
* A library of masks applicable to several Brazilian data like I.E., CNPJ, CPF and others
* @version v0.4.1
* @version v0.5.0
* @link http://github.com/the-darc/br-masks
* @license MIT
*/
(function (root, factory) {
/* istanbul ignore next */
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['string-mask'], factory);
Expand All @@ -19,6 +20,7 @@
root.BrM = factory(root.StringMask);
}
}(this, function (StringMask) {
/* istanbul ignore if */
if (!StringMask) {
throw new Error('StringMask not found');
}
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 7d47cf9

Please sign in to comment.