Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

credit-card-regex

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

credit-card-regex - npm Package Compare versions

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 @@ *

2

package.json
{
"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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc