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

creditable

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

creditable - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

.travis.yml

24

creditablecardtype.js

@@ -5,9 +5,22 @@ // Input a credit card number string, returns a key signifying the type of credit card it is

var types = {
MASTERCARD: /^(2[2-7]|5[1-5])/, // 22-27 and 51-55
VISA: /^4/,
DISCOVER: /^6(011|5)/, // 6011 or 65
AMEX: /^3[47]/ // 34 or 37
var keys = {
MASTERCARD: "MASTERCARD",
VISA: "VISA",
DISCOVER: "DISCOVER",
AMEX: "AMEX"
};
var types = {};
// 2221-2720 and 51-55
types[ keys.MASTERCARD ] = /^(222[1-9]|22[3-9]|2[3-6]|27[01]|2720|5[1-5])/;
types[ keys.VISA ] = /^4/;
// 6011 or 65
types[ keys.DISCOVER ] = /^6(011|22(12[6-9]|1[3-9]|[2-8]|9[0-1]|92[0-5])|4[4-9]|5)/;
// 34 or 37
types[ keys.AMEX ] = /^3[47]/;
function CreditableCardType( val ) {

@@ -23,2 +36,3 @@ for( var j in types ) {

CreditableCardType.KEYS = keys;
CreditableCardType.TYPES = types;

@@ -25,0 +39,0 @@ w.CreditableCardType = CreditableCardType;

{
"name": "creditable",
"version": "1.0.7",
"version": "1.0.8",
"description": "Utilities for working with credit card form input.",

@@ -16,5 +16,13 @@ "main": "creditablecardtype.js",

"homepage": "https://github.com/filamentgroup/creditable#readme",
"scripts": {
"test": "./node_modules/.bin/grunt test"
},
"dependencies": {
"shoestring": "^1.0.3"
},
"devDependencies": {
"grunt": "^1.0.1",
"grunt-contrib-qunit": "^1.2.0",
"qunitjs": "^2.0.1"
}
}
# creditable
[![npm version](https://badge.fury.io/js/creditable.svg)](https://badge.fury.io/js/creditable)
[![Build Status](https://img.shields.io/travis/filamentgroup/creditable/master.svg)](https://travis-ci.org/filamentgroup/creditable)
[![Dependency Status](https://david-dm.org/filamentgroup/creditable.svg?theme=shields.io)](https://david-dm.org/filamentgroup/creditable)
Utilities for working with credit card form input.

@@ -14,3 +19,3 @@

CreditableCardType( "6011 1234 1234 1234" );
// returns "MASTERCARD";
// returns "DISCOVER";

@@ -17,0 +22,0 @@ CreditableCardType( "3412 123456 12345" );

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