credit-card-type
Advanced tools
Comparing version 5.0.1 to 5.0.2
@@ -0,1 +1,6 @@ | ||
5.0.2 | ||
===== | ||
- Fix checking for UnionPay ranges | ||
5.0.1 | ||
@@ -2,0 +7,0 @@ ===== |
@@ -124,4 +124,4 @@ !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){ | ||
type: UNIONPAY, | ||
prefixPattern: /^(6|62)$/, | ||
exactPattern: /^62\d*$/, | ||
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], | ||
@@ -128,0 +128,0 @@ lengths: [16, 17, 18, 19], |
@@ -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 a(s,p){if(!n[s]){if(!t[s]){var o="function"==typeof require&&require;if(!p&&o)return o(s,!0);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var f=n[s]={exports:{}};t[s][0].call(f.exports,function(e){var n=t[s][1][e];return a(n?n:e)},f,f.exports,e,t,n,r)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;s<r.length;s++)a(r[s]);return a}({1:[function(e,t,n){"use strict";function r(e){var t,n,r;return e?(t=e.prefixPattern.source,n=e.exactPattern.source,r=JSON.parse(JSON.stringify(e)),r.prefixPattern=t,r.exactPattern=n,r):null}function a(e){var t,n,a,s=[],p=[];if(!("string"==typeof e||e instanceof String))return[];for(a=0;a<m.length;a++)t=m[a],n=i[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 i={},s="visa",p="master-card",o="american-express",c="diners-club",f="discover",u="jcb",d="unionpay",x="maestro",y="CVV",l="CID",g="CVC",P="CVN",m=[s,p,o,c,f,u,d,x];i[s]={niceType:"Visa",type:s,prefixPattern:/^4$/,exactPattern:/^4\d*$/,gaps:[4,8,12],lengths:[16,18,19],code:{name:y,size:3}},i[p]={niceType:"MasterCard",type:p,prefixPattern:/^(5|5[1-5]|2|22|222|222[1-9]|2[3-6]|27[0-1]|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}},i[o]={niceType:"American Express",type:o,prefixPattern:/^(3|34|37)$/,exactPattern:/^3[47]\d*$/,isAmex:!0,gaps:[4,10],lengths:[15],code:{name:l,size:4}},i[c]={niceType:"Diners Club",type:c,prefixPattern:/^(3|3[0689]|30[0-5])$/,exactPattern:/^3(0[0-5]|[689])\d*$/,gaps:[4,10],lengths:[14],code:{name:y,size:3}},i[f]={niceType:"Discover",type:f,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:l,size:3}},i[u]={niceType:"JCB",type:u,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}},i[d]={niceType:"UnionPay",type:d,prefixPattern:/^(6|62)$/,exactPattern:/^62\d*$/,gaps:[4,8,12],lengths:[16,17,18,19],code:{name:P,size:3}},i[x]={niceType:"Maestro",type:x,prefixPattern:/^(5|5[06-9]|6\d*)$/,exactPattern:/^5[06-9]\d*$/,gaps:[4,8,12],lengths:[12,13,14,15,16,17,18,19],code:{name:g,size:3}},a.getTypeInfo=function(e){return r(i[e])},a.types={VISA:s,MASTERCARD:p,AMERICAN_EXPRESS:o,DINERS_CLUB:c,DISCOVER:f,JCB:u,UNIONPAY:d,MAESTRO:x},t.exports=a},{}]},{},[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 a(s,p){if(!n[s]){if(!t[s]){var o="function"==typeof require&&require;if(!p&&o)return o(s,!0);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var f=n[s]={exports:{}};t[s][0].call(f.exports,function(e){var n=t[s][1][e];return a(n?n:e)},f,f.exports,e,t,n,r)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;s<r.length;s++)a(r[s]);return a}({1:[function(e,t,n){"use strict";function r(e){var t,n,r;return e?(t=e.prefixPattern.source,n=e.exactPattern.source,r=JSON.parse(JSON.stringify(e)),r.prefixPattern=t,r.exactPattern=n,r):null}function a(e){var t,n,a,s=[],p=[];if(!("string"==typeof e||e instanceof String))return[];for(a=0;a<m.length;a++)t=m[a],n=i[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 i={},s="visa",p="master-card",o="american-express",c="diners-club",f="discover",d="jcb",u="unionpay",x="maestro",y="CVV",l="CID",g="CVC",P="CVN",m=[s,p,o,c,f,d,u,x];i[s]={niceType:"Visa",type:s,prefixPattern:/^4$/,exactPattern:/^4\d*$/,gaps:[4,8,12],lengths:[16,18,19],code:{name:y,size:3}},i[p]={niceType:"MasterCard",type:p,prefixPattern:/^(5|5[1-5]|2|22|222|222[1-9]|2[3-6]|27[0-1]|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}},i[o]={niceType:"American Express",type:o,prefixPattern:/^(3|34|37)$/,exactPattern:/^3[47]\d*$/,isAmex:!0,gaps:[4,10],lengths:[15],code:{name:l,size:4}},i[c]={niceType:"Diners Club",type:c,prefixPattern:/^(3|3[0689]|30[0-5])$/,exactPattern:/^3(0[0-5]|[689])\d*$/,gaps:[4,10],lengths:[14],code:{name:y,size:3}},i[f]={niceType:"Discover",type:f,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:l,size:3}},i[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}},i[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}},i[x]={niceType:"Maestro",type:x,prefixPattern:/^(5|5[06-9]|6\d*)$/,exactPattern:/^5[06-9]\d*$/,gaps:[4,8,12],lengths:[12,13,14,15,16,17,18,19],code:{name:g,size:3}},a.getTypeInfo=function(e){return r(i[e])},a.types={VISA:s,MASTERCARD:p,AMERICAN_EXPRESS:o,DINERS_CLUB:c,DISCOVER:f,JCB:d,UNIONPAY:u,MAESTRO:x},t.exports=a},{}]},{},[1])(1)}); |
@@ -123,4 +123,4 @@ 'use strict'; | ||
type: UNIONPAY, | ||
prefixPattern: /^(6|62)$/, | ||
exactPattern: /^62\d*$/, | ||
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], | ||
@@ -127,0 +127,0 @@ lengths: [16, 17, 18, 19], |
{ | ||
"name": "credit-card-type", | ||
"version": "5.0.1", | ||
"version": "5.0.2", | ||
"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
21649
8