credit-card-regex
Advanced tools
Comparing version 1.0.1 to 1.1.0
26
index.js
'use strict'; | ||
var americanExpress = '(?:3[47][0-9]{13})'; | ||
var discover = '(?:6)(?:011|5[0-9]{2})(?:[0-9]{12})'; | ||
var dinersClub = '(?:3(?:0[0-5]|[68][0-9])[0-9]{11})'; | ||
var discover = '(?:6(?:011|5[0-9]{2})(?:[0-9]{12}))'; | ||
var jcb = '(?:2131|1800|35\\d{3})\\d{11}'; | ||
var mastercard = '(?:5[1-5][0-9]{14})'; | ||
@@ -17,3 +19,5 @@ var visa = '(?:4[0-9]{12})(?:[0-9]{3})?'; | ||
americanExpress, | ||
dinersClub, | ||
discover, | ||
jcb, | ||
mastercard, | ||
@@ -35,2 +39,12 @@ visa | ||
/** | ||
* Diners Club | ||
* | ||
* @api public | ||
*/ | ||
module.exports.dinersClub = function () { | ||
return new RegExp('(?:^|\\s)?(["\'])?' + dinersClub + '\\1', 'g'); | ||
}; | ||
/** | ||
* Discover | ||
@@ -46,2 +60,12 @@ * | ||
/** | ||
* JCB | ||
* | ||
* @api public | ||
*/ | ||
module.exports.jcb = function () { | ||
return new RegExp('(?:^|\\s)?(["\'])?' + jcb + '\\1', 'g'); | ||
}; | ||
/** | ||
* Mastercard | ||
@@ -48,0 +72,0 @@ * |
{ | ||
"name": "credit-card-regex", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Regular expression for matching credit card numbers", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3786
70
1842