Skip to content

Commit

Permalink
Merge pull request #47 from fernahh/v2.1.0
Browse files Browse the repository at this point in the history
Bump version to v2.1.0
  • Loading branch information
fernahh authored Aug 22, 2016
2 parents 7d41392 + bf05b5e commit 7040aa2
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 11 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

> A simple credit cards validation library in JavaScript.
<img src="assets/images/credit-card-logo.png" alt="creditcard.js" />

## Install

You can [download the zip file](https://github.com/contaazul/creditcard.js/archive/master.zip) or use NPM and Bower.
Expand Down
Binary file removed assets/images/credit-card-logo.png
Binary file not shown.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "creditcard.js",
"description": "A simple library for credit-card validation in JavaScript",
"main": "dist/creditcard.min.js",
"version": "2.0.3",
"version": "2.1.0",
"authors": [
"@ContaAzul"
],
Expand Down
8 changes: 5 additions & 3 deletions dist/creditcard.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* creditcard.js v2.0.3
* creditcard.js v2.1.0
* Created by @ContaAzul.
*
* Licensed MIT.
Expand Down Expand Up @@ -53,7 +53,7 @@ var CreditCard = function () {
key: 'isSecurityCodeValid',
value: function isSecurityCodeValid(number, code) {
var brand = this.getCreditCardNameByNumber(number);
var numberLength = undefined;
var numberLength = void 0;

numberLength = brand === 'Amex' ? 4 : 3;
var regex = new RegExp('^[0-9]{' + numberLength + '}$');
Expand All @@ -69,6 +69,8 @@ var CreditCard = function () {
m = parseInt(m, 10);
y = parseInt(y, 10);

if (isNaN(m) || isNaN(y)) return false;

if (m < 1 || m > 12) return false;

return !(y < 1000 || y >= 3000);
Expand Down Expand Up @@ -107,7 +109,7 @@ var CREDIT_CARD_LIST = [{
regexpFull: '^50[0-9]{14,17}$'
}, {
name: 'Mastercard',
regexpFull: '^5[1-5][0-9]{14}$'
regexpFull: '^(5[1-5][0-9]{14}|2221[0-9]{12}|222[2-9][0-9]{12}|22[3-9][0-9]{13}|2[3-6][0-9]{14}|27[01][0-9]{13}|2720[0-9]{12})$'
}, {
name: 'Visa',
regexpFull: '^4[0-9]{12}(?:[0-9]{3})?$'
Expand Down
4 changes: 2 additions & 2 deletions dist/creditcard.min.js

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "creditcard.js",
"version": "2.0.3",
"version": "2.1.0",
"description": "A simple library for credit-card validation in JavaScript",
"main": "dist/creditcard.min.js",
"repository": "ContaAzul/creditcard.js",
Expand Down
3 changes: 1 addition & 2 deletions src/creditCardList.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ const CREDIT_CARD_LIST = [
regexpFull: '^50[0-9]{14,17}$'
}, {
name: 'Mastercard',
regexpFull: '^5[1-5][0-9]{14}$'
//regexpFull: '^(5[1-5][0-9]{14}|2221[0-9]{12}|222[2-9][0-9]{12}|22[3-9][0-9]{13}|2[3-6][0-9]{14}|27[01][0-9]{13}|2720[0-9]{12})$' //After October
regexpFull: '^(5[1-5][0-9]{14}|2221[0-9]{12}|222[2-9][0-9]{12}|22[3-9][0-9]{13}|2[3-6][0-9]{14}|27[01][0-9]{13}|2720[0-9]{12})$'
}, {
name: 'Visa',
regexpFull: '^4[0-9]{12}(?:[0-9]{3})?$'
Expand Down

0 comments on commit 7040aa2

Please sign in to comment.