credit-card-type
Advanced tools
Comparing version 6.0.0 to 6.1.0
@@ -0,1 +1,6 @@ | ||
6.1.0 | ||
===== | ||
- Add support for JCB cards of length 17, 18, and 19 (#54, thanks @zeh) | ||
6.0.0 | ||
@@ -2,0 +7,0 @@ ===== |
@@ -112,3 +112,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], | ||
lengths: [16, 17, 18, 19], | ||
code: { | ||
@@ -115,0 +115,0 @@ name: CVV, |
@@ -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(s,p){if(!n[s]){if(!t[s]){var o="function"==typeof require&&require;if(!p&&o)return o(s,!0);if(a)return a(s,!0);var f=new Error("Cannot find module '"+s+"'");throw f.code="MODULE_NOT_FOUND",f}var c=n[s]={exports:{}};t[s][0].call(c.exports,function(e){var n=t[s][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[s].exports}for(var a="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(e,t,n){"use strict";function r(e){var t;return e?(t=JSON.parse(JSON.stringify(e)),delete t.prefixPattern,delete t.exactPattern,t):null}function i(e){var t,n,i,s=[],p=[];if(!("string"==typeof e||e instanceof String))return[];for(i=0;i<m.length;i++)t=m[i],n=a[t],0!==e.length?n.exactPattern.test(e)?p.push(r(n)):n.prefixPattern.test(e)&&s.push(r(n)):s.push(r(n));return p.length?p:s}var a={},s="visa",p="master-card",o="american-express",f="diners-club",c="discover",d="jcb",u="unionpay",l="maestro",y="CVV",x="CID",g="CVC",P="CVN",m=[s,p,o,f,c,d,u,l];a[s]={niceType:"Visa",type:s,prefixPattern:/^4$/,exactPattern:/^4\d*$/,gaps:[4,8,12],lengths:[16,18,19],code:{name:y,size:3}},a[p]={niceType:"Mastercard",type:p,prefixPattern:/^(5|5[1-5]|2|22|222|222[1-9]|2[3-6]|27|27[0-2]|2720)$/,exactPattern:/^(5[1-5]|222[1-9]|2[3-6]|27[0-1]|2720)\d*$/,gaps:[4,8,12],lengths:[16],code:{name:g,size:3}},a[o]={niceType:"American Express",type:o,prefixPattern:/^(3|34|37)$/,exactPattern:/^3[47]\d*$/,isAmex:!0,gaps:[4,10],lengths:[15],code:{name:x,size:4}},a[f]={niceType:"Diners Club",type:f,prefixPattern:/^(3|3[0689]|30[0-5])$/,exactPattern:/^3(0[0-5]|[689])\d*$/,gaps:[4,10],lengths:[14,16,19],code:{name:y,size:3}},a[c]={niceType:"Discover",type:c,prefixPattern:/^(6|60|601|6011|65|64|64[4-9])$/,exactPattern:/^(6011|65|64[4-9])\d*$/,gaps:[4,8,12],lengths:[16,19],code:{name:x,size:3}},a[d]={niceType:"JCB",type:d,prefixPattern:/^(2|21|213|2131|1|18|180|1800|3|35)$/,exactPattern:/^(2131|1800|35)\d*$/,gaps:[4,8,12],lengths:[16],code:{name:y,size:3}},a[u]={niceType:"UnionPay",type:u,prefixPattern:/^((6|62|62\d|(621(?!83|88|98|99))|622(?!06)|627[02,06,07]|628(?!0|1)|629[1,2])|622018)$/,exactPattern:/^(((620|(621(?!83|88|98|99))|622(?!06|018)|62[3-6]|627[02,06,07]|628(?!0|1)|629[1,2]))\d*|622018\d{12})$/,gaps:[4,8,12],lengths:[16,17,18,19],code:{name:P,size:3}},a[l]={niceType:"Maestro",type:l,prefixPattern:/^(5|5[06-9]|6\d*)$/,exactPattern:/^(5[06-9]|6[37])\d*$/,gaps:[4,8,12],lengths:[12,13,14,15,16,17,18,19],code:{name:g,size:3}},i.getTypeInfo=function(e){return r(a[e])},i.types={VISA:s,MASTERCARD:p,AMERICAN_EXPRESS:o,DINERS_CLUB:f,DISCOVER:c,JCB:d,UNIONPAY:u,MAESTRO:l},t.exports=i},{}]},{},[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(s,p){if(!n[s]){if(!t[s]){var o="function"==typeof require&&require;if(!p&&o)return o(s,!0);if(a)return a(s,!0);var f=new Error("Cannot find module '"+s+"'");throw f.code="MODULE_NOT_FOUND",f}var c=n[s]={exports:{}};t[s][0].call(c.exports,function(e){var n=t[s][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[s].exports}for(var a="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(e,t,n){"use strict";function r(e){var t;return e?(t=JSON.parse(JSON.stringify(e)),delete t.prefixPattern,delete t.exactPattern,t):null}function i(e){var t,n,i,s=[],p=[];if(!("string"==typeof e||e instanceof String))return[];for(i=0;i<m.length;i++)t=m[i],n=a[t],0!==e.length?n.exactPattern.test(e)?p.push(r(n)):n.prefixPattern.test(e)&&s.push(r(n)):s.push(r(n));return p.length?p:s}var a={},s="visa",p="master-card",o="american-express",f="diners-club",c="discover",d="jcb",u="unionpay",l="maestro",y="CVV",x="CID",g="CVC",P="CVN",m=[s,p,o,f,c,d,u,l];a[s]={niceType:"Visa",type:s,prefixPattern:/^4$/,exactPattern:/^4\d*$/,gaps:[4,8,12],lengths:[16,18,19],code:{name:y,size:3}},a[p]={niceType:"Mastercard",type:p,prefixPattern:/^(5|5[1-5]|2|22|222|222[1-9]|2[3-6]|27|27[0-2]|2720)$/,exactPattern:/^(5[1-5]|222[1-9]|2[3-6]|27[0-1]|2720)\d*$/,gaps:[4,8,12],lengths:[16],code:{name:g,size:3}},a[o]={niceType:"American Express",type:o,prefixPattern:/^(3|34|37)$/,exactPattern:/^3[47]\d*$/,isAmex:!0,gaps:[4,10],lengths:[15],code:{name:x,size:4}},a[f]={niceType:"Diners Club",type:f,prefixPattern:/^(3|3[0689]|30[0-5])$/,exactPattern:/^3(0[0-5]|[689])\d*$/,gaps:[4,10],lengths:[14,16,19],code:{name:y,size:3}},a[c]={niceType:"Discover",type:c,prefixPattern:/^(6|60|601|6011|65|64|64[4-9])$/,exactPattern:/^(6011|65|64[4-9])\d*$/,gaps:[4,8,12],lengths:[16,19],code:{name:x,size:3}},a[d]={niceType:"JCB",type:d,prefixPattern:/^(2|21|213|2131|1|18|180|1800|3|35)$/,exactPattern:/^(2131|1800|35)\d*$/,gaps:[4,8,12],lengths:[16,17,18,19],code:{name:y,size:3}},a[u]={niceType:"UnionPay",type:u,prefixPattern:/^((6|62|62\d|(621(?!83|88|98|99))|622(?!06)|627[02,06,07]|628(?!0|1)|629[1,2])|622018)$/,exactPattern:/^(((620|(621(?!83|88|98|99))|622(?!06|018)|62[3-6]|627[02,06,07]|628(?!0|1)|629[1,2]))\d*|622018\d{12})$/,gaps:[4,8,12],lengths:[16,17,18,19],code:{name:P,size:3}},a[l]={niceType:"Maestro",type:l,prefixPattern:/^(5|5[06-9]|6\d*)$/,exactPattern:/^(5[06-9]|6[37])\d*$/,gaps:[4,8,12],lengths:[12,13,14,15,16,17,18,19],code:{name:g,size:3}},i.getTypeInfo=function(e){return r(a[e])},i.types={VISA:s,MASTERCARD:p,AMERICAN_EXPRESS:o,DINERS_CLUB:f,DISCOVER:c,JCB:d,UNIONPAY:u,MAESTRO:l},t.exports=i},{}]},{},[1])(1)}); |
@@ -111,3 +111,3 @@ 'use strict'; | ||
gaps: [4, 8, 12], | ||
lengths: [16], | ||
lengths: [16, 17, 18, 19], | ||
code: { | ||
@@ -114,0 +114,0 @@ name: CVV, |
{ | ||
"name": "credit-card-type", | ||
"version": "6.0.0", | ||
"version": "6.1.0", | ||
"description": "A library for determining credit card type", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
21707