Skip to content

Commit

Permalink
Merge pull request #539 from dhAlcojor/master
Browse files Browse the repository at this point in the history
Fix issue #535 and add test cases
  • Loading branch information
chriso committed Jun 9, 2016
2 parents 3c9b751 + 5853b17 commit 9bfb273
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
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})$/;
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}$/;
/* eslint-enable max-len */

export default function isCreditCard(str) {
Expand Down
6 changes: 6 additions & 0 deletions test/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -1475,6 +1475,12 @@ describe('Validators', function () {
'4716-2210-5188-5662',
'4929 7226 5379 7141',
'5398228707871527',
'6283875070985593',
'6263892624162870',
'6234917882863855',
'6234698580215388',
'6226050967750613',
'6246281879460688',
],
invalid: [
'foo',
Expand Down

0 comments on commit 9bfb273

Please sign in to comment.