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

credit-card-type

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

credit-card-type - npm Package Compare versions

Comparing version 8.1.0 to 8.2.0

5

CHANGELOG.md

@@ -0,1 +1,6 @@

8.2.0
=====
- Add 14 and 15 length configuration to UnionPay cards
8.1.0

@@ -2,0 +7,0 @@ =====

2

dist/js/app.built.js

@@ -307,3 +307,3 @@ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.creditCardType=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){

gaps: [4, 8, 12],
lengths: [16, 17, 18, 19],
lengths: [14, 15, 16, 17, 18, 19],
code: {

@@ -310,0 +310,0 @@ name: 'CVN',

@@ -1,1 +0,1 @@

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.creditCardType=e()}}(function(){return function e(t,n,r){function i(a,o){if(!n[a]){if(!t[a]){var c="function"==typeof require&&require;if(!o&&c)return c(a,!0);if(s)return s(a,!0);var p=new Error("Cannot find module '"+a+"'");throw p.code="MODULE_NOT_FOUND",p}var u=n[a]={exports:{}};t[a][0].call(u.exports,function(e){var n=t[a][1][e];return i(n?n:e)},u,u.exports,e,t,n,r)}return n[a].exports}for(var s="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(e,t,n){"use strict";function r(e){return l[e]||c[e]}function i(){return o.map(function(e){return p(r(e))})}function s(e,t){var n=o.indexOf(e);if(!t&&n===-1)throw new Error('"'+e+'" is not a supported card type.');return n}function a(e){var t,n=[];return f(e)?0===e.length?i(o):(o.forEach(function(t){var i=r(t);d(e,i,n)}),t=u(n),t?[t]:n):[]}var o,c=e("./lib/card-types"),p=e("./lib/clone"),u=e("./lib/find-best-match"),f=e("./lib/is-valid-input-type"),d=e("./lib/add-matching-cards-to-results"),l={},y={VISA:"visa",MASTERCARD:"mastercard",AMERICAN_EXPRESS:"american-express",DINERS_CLUB:"diners-club",DISCOVER:"discover",JCB:"jcb",UNIONPAY:"unionpay",MAESTRO:"maestro",ELO:"elo",MIR:"mir",HIPER:"hiper",HIPERCARD:"hipercard"},g=[y.VISA,y.MASTERCARD,y.AMERICAN_EXPRESS,y.DINERS_CLUB,y.DISCOVER,y.JCB,y.UNIONPAY,y.MAESTRO,y.ELO,y.MIR,y.HIPER,y.HIPERCARD];o=p(g),a.getTypeInfo=function(e){return p(r(e))},a.removeCard=function(e){var t=s(e);o.splice(t,1)},a.addCard=function(e){var t=s(e.type,!0);l[e.type]=e,t===-1&&o.push(e.type)},a.updateCard=function(e,t){var n,r=l[e]||c[e];if(!r)throw new Error('"'+e+'" is not a recognized type. Use `addCard` instead.');if(t.type&&r.type!==t.type)throw new Error("Cannot overwrite type parameter.");n=p(r,!0),Object.keys(n).forEach(function(e){t[e]&&(n[e]=t[e])}),l[n.type]=n},a.changeOrder=function(e,t){var n=s(e);o.splice(n,1),o.splice(t,0,e)},a.resetModifications=function(){o=p(g),l={}},a.types=y,t.exports=a},{"./lib/add-matching-cards-to-results":2,"./lib/card-types":3,"./lib/clone":4,"./lib/find-best-match":5,"./lib/is-valid-input-type":6}],2:[function(e,t,n){"use strict";function r(e,t,n){var r,a,o,c;for(r=0;r<t.patterns.length;r++)if(a=t.patterns[r],s(e,a)){c=i(t),o=Array.isArray(a)?String(a[0]).length:String(a).length,e.length>=o&&(c.matchStrength=o),n.push(c);break}}var i=e("./clone"),s=e("./matches");t.exports=r},{"./clone":4,"./matches":7}],3:[function(e,t,n){"use strict";var r={visa:{niceType:"Visa",type:"visa",patterns:[4],gaps:[4,8,12],lengths:[16,18,19],code:{name:"CVV",size:3}},mastercard:{niceType:"Mastercard",type:"mastercard",patterns:[[51,55],[2221,2229],[223,229],[23,26],[270,271],2720],gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}},"american-express":{niceType:"American Express",type:"american-express",patterns:[34,37],gaps:[4,10],lengths:[15],code:{name:"CID",size:4}},"diners-club":{niceType:"Diners Club",type:"diners-club",patterns:[[300,305],36,38,39],gaps:[4,10],lengths:[14,16,19],code:{name:"CVV",size:3}},discover:{niceType:"Discover",type:"discover",patterns:[6011,[644,649],65],gaps:[4,8,12],lengths:[16,19],code:{name:"CID",size:3}},jcb:{niceType:"JCB",type:"jcb",patterns:[2131,1800,[3528,3589]],gaps:[4,8,12],lengths:[16,17,18,19],code:{name:"CVV",size:3}},unionpay:{niceType:"UnionPay",type:"unionpay",patterns:[620,[624,626],[62100,62182],[62184,62187],[62185,62197],[62200,62205],[622010,622999],622018,[622019,622999],[62207,62209],[622126,622925],[623,626],6270,6272,6276,[627700,627779],[627781,627799],[6282,6289],6291,6292],gaps:[4,8,12],lengths:[16,17,18,19],code:{name:"CVN",size:3}},maestro:{niceType:"Maestro",type:"maestro",patterns:[493698,[5e5,506698],[506779,508999],[56,59],63,67,6],gaps:[4,8,12],lengths:[12,13,14,15,16,17,18,19],code:{name:"CVC",size:3}},elo:{niceType:"Elo",type:"elo",patterns:[401178,401179,438935,457631,457632,431274,451416,457393,504175,[506699,506778],[509e3,509999],627780,636297,636368,[650031,650033],[650035,650051],[650405,650439],[650485,650538],[650541,650598],[650700,650718],[650720,650727],[650901,650978],[651652,651679],[655e3,655019],[655021,655058]],gaps:[4,8,12],lengths:[16],code:{name:"CVE",size:3}},mir:{niceType:"Mir",type:"mir",patterns:[[2200,2204]],gaps:[4,8,12],lengths:[16,17,18,19],code:{name:"CVP2",size:3}},hiper:{niceType:"Hiper",type:"hiper",patterns:[637095,637568,637599,637609,637612],gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}},hipercard:{niceType:"Hipercard",type:"hipercard",patterns:[606282],gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}}};t.exports=r},{}],4:[function(e,t,n){"use strict";function r(e){var t;return e?t=JSON.parse(JSON.stringify(e)):null}t.exports=r},{}],5:[function(e,t,n){"use strict";function r(e){var t=e.filter(function(e){return e.matchStrength}).length;return t>0&&t===e.length}function i(e){if(r(e))return e.reduce(function(e,t){return e?e.matchStrength<t.matchStrength?t:e:t})}t.exports=i},{}],6:[function(e,t,n){"use strict";function r(e){return"string"==typeof e||e instanceof String}t.exports=r},{}],7:[function(e,t,n){"use strict";function r(e,t,n){var r=String(t).length,i=e.substr(0,r),s=parseInt(i,10);return t=parseInt(String(t).substr(0,i.length),10),n=parseInt(String(n).substr(0,i.length),10),s>=t&&s<=n}function i(e,t){return t=String(t),t.substring(0,e.length)===e.substring(0,t.length)}function s(e,t){return Array.isArray(t)?r(e,t[0],t[1]):i(e,t)}t.exports=s},{}]},{},[1])(1)});
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.creditCardType=e()}}(function(){return function e(t,n,r){function i(a,o){if(!n[a]){if(!t[a]){var c="function"==typeof require&&require;if(!o&&c)return c(a,!0);if(s)return s(a,!0);var p=new Error("Cannot find module '"+a+"'");throw p.code="MODULE_NOT_FOUND",p}var u=n[a]={exports:{}};t[a][0].call(u.exports,function(e){var n=t[a][1][e];return i(n?n:e)},u,u.exports,e,t,n,r)}return n[a].exports}for(var s="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(e,t,n){"use strict";function r(e){return l[e]||c[e]}function i(){return o.map(function(e){return p(r(e))})}function s(e,t){var n=o.indexOf(e);if(!t&&n===-1)throw new Error('"'+e+'" is not a supported card type.');return n}function a(e){var t,n=[];return f(e)?0===e.length?i(o):(o.forEach(function(t){var i=r(t);d(e,i,n)}),t=u(n),t?[t]:n):[]}var o,c=e("./lib/card-types"),p=e("./lib/clone"),u=e("./lib/find-best-match"),f=e("./lib/is-valid-input-type"),d=e("./lib/add-matching-cards-to-results"),l={},y={VISA:"visa",MASTERCARD:"mastercard",AMERICAN_EXPRESS:"american-express",DINERS_CLUB:"diners-club",DISCOVER:"discover",JCB:"jcb",UNIONPAY:"unionpay",MAESTRO:"maestro",ELO:"elo",MIR:"mir",HIPER:"hiper",HIPERCARD:"hipercard"},g=[y.VISA,y.MASTERCARD,y.AMERICAN_EXPRESS,y.DINERS_CLUB,y.DISCOVER,y.JCB,y.UNIONPAY,y.MAESTRO,y.ELO,y.MIR,y.HIPER,y.HIPERCARD];o=p(g),a.getTypeInfo=function(e){return p(r(e))},a.removeCard=function(e){var t=s(e);o.splice(t,1)},a.addCard=function(e){var t=s(e.type,!0);l[e.type]=e,t===-1&&o.push(e.type)},a.updateCard=function(e,t){var n,r=l[e]||c[e];if(!r)throw new Error('"'+e+'" is not a recognized type. Use `addCard` instead.');if(t.type&&r.type!==t.type)throw new Error("Cannot overwrite type parameter.");n=p(r,!0),Object.keys(n).forEach(function(e){t[e]&&(n[e]=t[e])}),l[n.type]=n},a.changeOrder=function(e,t){var n=s(e);o.splice(n,1),o.splice(t,0,e)},a.resetModifications=function(){o=p(g),l={}},a.types=y,t.exports=a},{"./lib/add-matching-cards-to-results":2,"./lib/card-types":3,"./lib/clone":4,"./lib/find-best-match":5,"./lib/is-valid-input-type":6}],2:[function(e,t,n){"use strict";function r(e,t,n){var r,a,o,c;for(r=0;r<t.patterns.length;r++)if(a=t.patterns[r],s(e,a)){c=i(t),o=Array.isArray(a)?String(a[0]).length:String(a).length,e.length>=o&&(c.matchStrength=o),n.push(c);break}}var i=e("./clone"),s=e("./matches");t.exports=r},{"./clone":4,"./matches":7}],3:[function(e,t,n){"use strict";var r={visa:{niceType:"Visa",type:"visa",patterns:[4],gaps:[4,8,12],lengths:[16,18,19],code:{name:"CVV",size:3}},mastercard:{niceType:"Mastercard",type:"mastercard",patterns:[[51,55],[2221,2229],[223,229],[23,26],[270,271],2720],gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}},"american-express":{niceType:"American Express",type:"american-express",patterns:[34,37],gaps:[4,10],lengths:[15],code:{name:"CID",size:4}},"diners-club":{niceType:"Diners Club",type:"diners-club",patterns:[[300,305],36,38,39],gaps:[4,10],lengths:[14,16,19],code:{name:"CVV",size:3}},discover:{niceType:"Discover",type:"discover",patterns:[6011,[644,649],65],gaps:[4,8,12],lengths:[16,19],code:{name:"CID",size:3}},jcb:{niceType:"JCB",type:"jcb",patterns:[2131,1800,[3528,3589]],gaps:[4,8,12],lengths:[16,17,18,19],code:{name:"CVV",size:3}},unionpay:{niceType:"UnionPay",type:"unionpay",patterns:[620,[624,626],[62100,62182],[62184,62187],[62185,62197],[62200,62205],[622010,622999],622018,[622019,622999],[62207,62209],[622126,622925],[623,626],6270,6272,6276,[627700,627779],[627781,627799],[6282,6289],6291,6292],gaps:[4,8,12],lengths:[14,15,16,17,18,19],code:{name:"CVN",size:3}},maestro:{niceType:"Maestro",type:"maestro",patterns:[493698,[5e5,506698],[506779,508999],[56,59],63,67,6],gaps:[4,8,12],lengths:[12,13,14,15,16,17,18,19],code:{name:"CVC",size:3}},elo:{niceType:"Elo",type:"elo",patterns:[401178,401179,438935,457631,457632,431274,451416,457393,504175,[506699,506778],[509e3,509999],627780,636297,636368,[650031,650033],[650035,650051],[650405,650439],[650485,650538],[650541,650598],[650700,650718],[650720,650727],[650901,650978],[651652,651679],[655e3,655019],[655021,655058]],gaps:[4,8,12],lengths:[16],code:{name:"CVE",size:3}},mir:{niceType:"Mir",type:"mir",patterns:[[2200,2204]],gaps:[4,8,12],lengths:[16,17,18,19],code:{name:"CVP2",size:3}},hiper:{niceType:"Hiper",type:"hiper",patterns:[637095,637568,637599,637609,637612],gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}},hipercard:{niceType:"Hipercard",type:"hipercard",patterns:[606282],gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}}};t.exports=r},{}],4:[function(e,t,n){"use strict";function r(e){var t;return e?t=JSON.parse(JSON.stringify(e)):null}t.exports=r},{}],5:[function(e,t,n){"use strict";function r(e){var t=e.filter(function(e){return e.matchStrength}).length;return t>0&&t===e.length}function i(e){if(r(e))return e.reduce(function(e,t){return e?e.matchStrength<t.matchStrength?t:e:t})}t.exports=i},{}],6:[function(e,t,n){"use strict";function r(e){return"string"==typeof e||e instanceof String}t.exports=r},{}],7:[function(e,t,n){"use strict";function r(e,t,n){var r=String(t).length,i=e.substr(0,r),s=parseInt(i,10);return t=parseInt(String(t).substr(0,i.length),10),n=parseInt(String(n).substr(0,i.length),10),s>=t&&s<=n}function i(e,t){return t=String(t),t.substring(0,e.length)===e.substring(0,t.length)}function s(e,t){return Array.isArray(t)?r(e,t[0],t[1]):i(e,t)}t.exports=s},{}]},{},[1])(1)});

@@ -121,3 +121,3 @@ 'use strict';

gaps: [4, 8, 12],
lengths: [16, 17, 18, 19],
lengths: [14, 15, 16, 17, 18, 19],
code: {

@@ -124,0 +124,0 @@ name: 'CVN',

{
"name": "credit-card-type",
"version": "8.1.0",
"version": "8.2.0",
"description": "A library for determining credit card type",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -234,3 +234,3 @@ Credit Card Type [![Build Status](https://travis-ci.org/braintree/credit-card-type.svg)](https://travis-ci.org/braintree/credit-card-type) [![npm version](https://badge.fury.io/js/credit-card-type.svg)](http://badge.fury.io/js/credit-card-type) [![Bower](https://badge.fury.io/bo/credit-card-type.svg)](http://badge.fury.io/bo/credit-card-type)

var visa = creditCardType.getCardInfo(creditCardType.types.VISA);
var visa = creditCardType.getTypeInfo(creditCardType.types.VISA);

@@ -237,0 +237,0 @@ // overwritten properties

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