Skip to content

Commit

Permalink
Additional stuff for #576
Browse files Browse the repository at this point in the history
  • Loading branch information
chriso committed Sep 6, 2016
1 parent 1d3b44f commit b099e9e
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#### HEAD

- Added support for MasterCard 2-Series BIN
([#576](https://github.com/chriso/validator.js/pull/576))
- New locales
([#575](https://github.com/chriso/validator.js/pull/575))

Expand Down
2 changes: 1 addition & 1 deletion lib/isCreditCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ function isCreditCard(str) {
}
return !!(sum % 10 === 0 ? sanitized : false);
}
module.exports = exports['default'];
module.exports = exports['default'];
2 changes: 1 addition & 1 deletion src/lib/isCreditCard.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import assertString from './util/assertString';

/* eslint-disable max-len */
const creditCard = /^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})|62[0-9]{14}$/;
const creditCard = /^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})|62[0-9]{14}$/;
/* eslint-enable max-len */

export default function isCreditCard(str) {
Expand Down
4 changes: 2 additions & 2 deletions test/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -1603,15 +1603,15 @@ describe('Validators', function () {
'2222155765072228',
'2225855203075256',
'2720428011723762',
'2718760626256570'
'2718760626256570',
],
invalid: [
'foo',
'foo',
'5398228707871528',
'2718760626256571',
'2721465526338453',
'2220175103860763'
'2220175103860763',
],
});
});
Expand Down
2 changes: 1 addition & 1 deletion validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@
}

/* eslint-disable max-len */
var creditCard = /^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})|62[0-9]{14}$/;
var creditCard = /^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})|62[0-9]{14}$/;
/* eslint-enable max-len */

function isCreditCard(str) {
Expand Down
2 changes: 1 addition & 1 deletion validator.min.js

Large diffs are not rendered by default.

0 comments on commit b099e9e

Please sign in to comment.