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

card-validator

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

card-validator - npm Package Compare versions

Comparing version 2.2.0 to 2.2.1

5

CHANGELOG.md

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

2.2.1
=====
- Use one Lodash dependency
2.2.0

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

2

dist/card-validator.min.js

@@ -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 n;"undefined"!=typeof window?n=window:"undefined"!=typeof global?n=global:"undefined"!=typeof self&&(n=self),n.cardValidator=e()}}(function(){return function e(n,t,r){function o(i,s){if(!t[i]){if(!n[i]){var u="function"==typeof require&&require;if(!s&&u)return u(i,!0);if(a)return a(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var l=t[i]={exports:{}};n[i][0].call(l.exports,function(e){var t=n[i][1][e];return o(t?t:e)},l,l.exports,e,n,t,r)}return t[i].exports}for(var a="function"==typeof require&&require,i=0;i<r.length;i++)o(r[i]);return o}({1:[function(e,n,t){n.exports={number:e("./src/card-number"),expirationDate:e("./src/expiration-date"),expirationMonth:e("./src/expiration-month"),expirationYear:e("./src/expiration-year"),cvv:e("./src/cvv"),postalCode:e("./src/postal-code")}},{"./src/card-number":28,"./src/cvv":29,"./src/expiration-date":30,"./src/expiration-month":31,"./src/expiration-year":32,"./src/postal-code":35}],2:[function(e,n,t){var r=e("lodash.isstring"),o=e("lodash.clonedeep"),a=[{niceType:"Visa",type:"visa",pattern:"^4\\d*$",gaps:[4,8,12],lengths:[16],code:{name:"CVV",size:3}},{niceType:"MasterCard",type:"master-card",pattern:"^5[1-5]\\d*$",gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}},{niceType:"American Express",type:"american-express",pattern:"^3[47]\\d*$",isAmex:!0,gaps:[4,10],lengths:[15],code:{name:"CID",size:4}},{niceType:"DinersClub",type:"diners-club",pattern:"^3(0[0-5]|[689])\\d*$",gaps:[4,10],lengths:[14],code:{name:"CVV",size:3}},{niceType:"Discover",type:"discover",pattern:"^6(011|5|4[4-9])\\d*$",gaps:[4,8,12],lengths:[16],code:{name:"CID",size:3}},{niceType:"JCB",type:"jcb",pattern:"^(2131|1800|35)\\d*$",gaps:[4,8,12],lengths:[16],code:{name:"CVV",size:3}},{niceType:"UnionPay",type:"unionpay",pattern:"^62\\d*$",gaps:[4,8,12],lengths:[16,17,18,19],code:{name:"CVN",size:3}},{niceType:"Maestro",type:"maestro",pattern:"^(50|5[6-9]|6)\\d*$",gaps:[4,8,12],lengths:[12,13,14,15,16,17,18,19],code:{name:"CVC",size:3}}];n.exports=function(e){var n,t,i={};if(!r(e))return i;for(n in a)if(a.hasOwnProperty(n)&&(t=a[n],RegExp(t.pattern).test(e)))return o(t);return i}},{"lodash.clonedeep":3,"lodash.isstring":27}],3:[function(e,n,t){function r(e,n,t){return n="function"==typeof n&&a(n,t,1),o(e,!0,n)}var o=e("lodash._baseclone"),a=e("lodash._bindcallback");n.exports=r},{"lodash._baseclone":4,"lodash._bindcallback":14}],4:[function(e,n,t){(function(t){function r(e,n,t,a,l,h,g){var b;if(t&&(b=l?t(e,a,l):t(e)),void 0!==b)return b;if(!c(e))return e;var m=y(e);if(m){if(b=i(e),!n)return d(e,b)}else{var x=Y.call(e),j=x==w;if(x!=V&&x!=v&&(!j||l))return R[x]?u(e,x,n):l?e:{};if(b=s(j?{}:e),!n)return p(b,e)}h||(h=[]),g||(g=[]);for(var _=h.length;_--;)if(h[_]==e)return g[_];return h.push(e),g.push(b),(m?f:o)(e,function(o,a){b[a]=r(o,n,t,a,e,h,g)}),b}function o(e,n){return h(e,n,b)}function a(e){return W.call(e,0)}function i(e){var n=e.length,t=new e.constructor(n);return n&&"string"==typeof e[0]&&L.call(e,"index")&&(t.index=e.index,t.input=e.input),t}function s(e){var n=e.constructor;return"function"==typeof n&&n instanceof n||(n=Object),new n}function u(e,n,t){var r=e.constructor;switch(n){case C:return a(e);case x:case j:return new r(+e);case D:case P:case U:case M:case B:case T:case F:case I:case N:var o=e.buffer;return new r(t?a(o):o,e.byteOffset,e.length);case O:case E:return new r(e);case $:var i=new r(e.source,z.exec(e));i.lastIndex=e.lastIndex}return i}function c(e){var n=typeof e;return"function"==n||!!e&&"object"==n}function l(e){return function(){return e}}var d=e("lodash._arraycopy"),f=e("lodash._arrayeach"),p=e("lodash._baseassign"),h=e("lodash._basefor"),y=e("lodash.isarray"),g=e("lodash.isnative"),b=e("lodash.keys"),v="[object Arguments]",m="[object Array]",x="[object Boolean]",j="[object Date]",_="[object Error]",w="[object Function]",A="[object Map]",O="[object Number]",V="[object Object]",$="[object RegExp]",k="[object Set]",E="[object String]",S="[object WeakMap]",C="[object ArrayBuffer]",D="[object Float32Array]",P="[object Float64Array]",U="[object Int8Array]",M="[object Int16Array]",B="[object Int32Array]",T="[object Uint8Array]",F="[object Uint8ClampedArray]",I="[object Uint16Array]",N="[object Uint32Array]",z=/\w*$/,R={};R[v]=R[m]=R[C]=R[x]=R[j]=R[D]=R[P]=R[U]=R[M]=R[B]=R[O]=R[V]=R[$]=R[E]=R[T]=R[F]=R[I]=R[N]=!0,R[_]=R[w]=R[A]=R[k]=R[S]=!1;var q=Object.prototype,L=q.hasOwnProperty,Y=q.toString,J=g(J=t.ArrayBuffer)&&J,W=g(W=J&&new J(0).slice)&&W,G=Math.floor,H=g(H=t.Uint8Array)&&H,K=function(){try{var e=g(e=t.Float64Array)&&e,n=new e(new J(10),0,1)&&e}catch(r){}return n}(),Q=K?K.BYTES_PER_ELEMENT:0;W||(a=J&&H?function(e){var n=e.byteLength,t=K?G(n/Q):0,r=t*Q,o=new J(n);if(t){var a=new K(o,0,t);a.set(new K(e,0,t))}return n!=r&&(a=new H(o,r),a.set(new H(e,r))),o}:l(null)),n.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"lodash._arraycopy":5,"lodash._arrayeach":6,"lodash._baseassign":7,"lodash._basefor":9,"lodash.isarray":10,"lodash.isnative":11,"lodash.keys":12}],5:[function(e,n,t){function r(e,n){var t=-1,r=e.length;for(n||(n=Array(r));++t<r;)n[t]=e[t];return n}n.exports=r},{}],6:[function(e,n,t){function r(e,n){for(var t=-1,r=e.length;++t<r&&n(e[t],t,e)!==!1;);return e}n.exports=r},{}],7:[function(e,n,t){function r(e){return o(e)?e:Object(e)}function o(e){var n=typeof e;return"function"==n||!!e&&"object"==n}function a(e){return function(){return e}}var i=e("lodash._basecopy"),s=e("lodash.isnative"),u=e("lodash.keys"),c=s(c=Object.getOwnPropertySymbols)&&c,l=function(e,n){return null==n?e:i(n,d(n),i(n,u(n),e))},d=c?function(e){return c(r(e))}:a([]);n.exports=l},{"lodash._basecopy":8,"lodash.isnative":11,"lodash.keys":12}],8:[function(e,n,t){function r(e,n,t){t||(t={});for(var r=-1,o=n.length;++r<o;){var a=n[r];t[a]=e[a]}return t}n.exports=r},{}],9:[function(e,n,t){function r(e){return function(n,t,r){for(var a=o(n),i=r(n),s=i.length,u=e?s:-1;e?u--:++u<s;){var c=i[u];if(t(a[c],c,a)===!1)break}return n}}function o(e){return a(e)?e:Object(e)}function a(e){var n=typeof e;return"function"==n||!!e&&"object"==n}var i=r();n.exports=i},{}],10:[function(e,n,t){function r(e){return"string"==typeof e?e:null==e?"":e+""}function o(e){return!!e&&"object"==typeof e}function a(e){return"number"==typeof e&&e>-1&&e%1==0&&v>=e}function i(e){return null==e?!1:y.call(e)==c?g.test(h.call(e)):o(e)&&f.test(e)}function s(e){return e=r(e),e&&d.test(e)?e.replace(l,"\\$&"):e}var u="[object Array]",c="[object Function]",l=/[.*+?^${}()|[\]\/\\]/g,d=RegExp(l.source),f=/^\[object .+?Constructor\]$/,p=Object.prototype,h=Function.prototype.toString,y=p.toString,g=RegExp("^"+s(y).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),b=i(b=Array.isArray)&&b,v=Math.pow(2,53)-1,m=b||function(e){return o(e)&&a(e.length)&&y.call(e)==u};n.exports=m},{}],11:[function(e,n,t){function r(e){return"string"==typeof e?e:null==e?"":e+""}function o(e){return!!e&&"object"==typeof e}function a(e){return null==e?!1:p.call(e)==s?h.test(f.call(e)):o(e)&&l.test(e)}function i(e){return e=r(e),e&&c.test(e)?e.replace(u,"\\$&"):e}var s="[object Function]",u=/[.*+?^${}()|[\]\/\\]/g,c=RegExp(u.source),l=/^\[object .+?Constructor\]$/,d=Object.prototype,f=Function.prototype.toString,p=d.toString,h=RegExp("^"+i(p).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");n.exports=a},{}],12:[function(e,n,t){function r(e){return function(n){return null==n?void 0:n[e]}}function o(e){return null!=e&&i(m(e))}function a(e,n){return e=+e,n=null==n?b:n,e>-1&&e%1==0&&n>e}function i(e){return"number"==typeof e&&e>-1&&e%1==0&&b>=e}function s(e){for(var n=c(e),t=n.length,r=t&&e.length,o=r&&i(r)&&(d(e)||v.nonEnumArgs&&l(e)),s=-1,u=[];++s<t;){var f=n[s];(o&&a(f,r)||h.call(e,f))&&u.push(f)}return u}function u(e){var n=typeof e;return"function"==n||!!e&&"object"==n}function c(e){if(null==e)return[];u(e)||(e=Object(e));var n=e.length;n=n&&i(n)&&(d(e)||v.nonEnumArgs&&l(e))&&n||0;for(var t=e.constructor,r=-1,o="function"==typeof t&&t.prototype===e,s=Array(n),c=n>0;++r<n;)s[r]=r+"";for(var f in e)c&&a(f,n)||"constructor"==f&&(o||!h.call(e,f))||s.push(f);return s}var l=e("lodash.isarguments"),d=e("lodash.isarray"),f=e("lodash.isnative"),p=Object.prototype,h=p.hasOwnProperty,y=p.propertyIsEnumerable,g=f(g=Object.keys)&&g,b=Math.pow(2,53)-1,v={};!function(e){var n=function(){this.x=e},t=arguments,r=[];n.prototype={valueOf:e,y:e};for(var o in new n)r.push(o);try{v.nonEnumArgs=!y.call(t,1)}catch(a){v.nonEnumArgs=!0}}(1,0);var m=r("length"),x=g?function(e){var n=null!=e&&e.constructor;return"function"==typeof n&&n.prototype===e||"function"!=typeof e&&o(e)?s(e):u(e)?g(e):[]}:s;n.exports=x},{"lodash.isarguments":13,"lodash.isarray":10,"lodash.isnative":11}],13:[function(e,n,t){function r(e){return!!e&&"object"==typeof e}function o(e){return function(n){return null==n?void 0:n[e]}}function a(e){return null!=e&&i(f(e))}function i(e){return"number"==typeof e&&e>-1&&e%1==0&&d>=e}function s(e){return r(e)&&a(e)&&l.call(e)==u}var u="[object Arguments]",c=Object.prototype,l=c.toString,d=Math.pow(2,53)-1,f=o("length");n.exports=s},{}],14:[function(e,n,t){function r(e,n,t){if("function"!=typeof e)return o;if(void 0===n)return e;switch(t){case 1:return function(t){return e.call(n,t)};case 3:return function(t,r,o){return e.call(n,t,r,o)};case 4:return function(t,r,o,a){return e.call(n,t,r,o,a)};case 5:return function(t,r,o,a,i){return e.call(n,t,r,o,a,i)}}return function(){return e.apply(n,arguments)}}function o(e){return e}n.exports=r},{}],15:[function(e,n,t){function r(e,n,t){var r=l(n);p.apply(r,h(n));for(var o=-1,a=r.length;++o<a;){var i=r[o],s=e[i],u=t(s,n[i],i,e,n);(u===u?u===s:s!==s)&&(void 0!==s||i in e)||(e[i]=u)}return e}function o(e){return a(e)?e:Object(e)}function a(e){var n=typeof e;return"function"==n||!!e&&"object"==n}function i(e){return function(){return e}}var s=e("lodash._baseassign"),u=e("lodash._createassigner"),c=e("lodash.isnative"),l=e("lodash.keys"),d=Array.prototype,f=c(f=Object.getOwnPropertySymbols)&&f,p=d.push,h=f?function(e){return f(o(e))}:i([]),y=u(function(e,n,t){return t?r(e,n,t):s(e,n)});n.exports=y},{"lodash._baseassign":16,"lodash._createassigner":18,"lodash.isnative":22,"lodash.keys":23}],16:[function(e,n,t){n.exports=e(7)},{"/Users/mrak/Developer/Braintree/card-validator/node_modules/credit-card-type/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/index.js":7,"lodash._basecopy":17,"lodash.isnative":22,"lodash.keys":23}],17:[function(e,n,t){n.exports=e(8)},{"/Users/mrak/Developer/Braintree/card-validator/node_modules/credit-card-type/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/node_modules/lodash._basecopy/index.js":8}],18:[function(e,n,t){function r(e){return i(function(n,t){var r=-1,i=null==n?0:t.length,s=i>2&&t[i-2],u=i>2&&t[2],c=i>1&&t[i-1];for("function"==typeof s?(s=o(s,c,5),i-=2):(s="function"==typeof c?c:null,i-=s?1:0),u&&a(t[0],t[1],u)&&(s=3>i?null:s,i=1);++r<i;){var l=t[r];l&&e(n,l,s)}return n})}var o=e("lodash._bindcallback"),a=e("lodash._isiterateecall"),i=e("lodash.restparam");n.exports=r},{"lodash._bindcallback":19,"lodash._isiterateecall":20,"lodash.restparam":21}],19:[function(e,n,t){n.exports=e(14)},{"/Users/mrak/Developer/Braintree/card-validator/node_modules/credit-card-type/node_modules/lodash.clonedeep/node_modules/lodash._bindcallback/index.js":14}],20:[function(e,n,t){function r(e){return function(n){return null==n?void 0:n[e]}}function o(e){return null!=e&&s(l(e))}function a(e,n){return e=+e,n=null==n?c:n,e>-1&&e%1==0&&n>e}function i(e,n,t){if(!u(t))return!1;var r=typeof n;if("number"==r?o(t)&&a(n,t.length):"string"==r&&n in t){var i=t[n];return e===e?e===i:i!==i}return!1}function s(e){return"number"==typeof e&&e>-1&&e%1==0&&c>=e}function u(e){var n=typeof e;return"function"==n||!!e&&"object"==n}var c=Math.pow(2,53)-1,l=r("length");n.exports=i},{}],21:[function(e,n,t){function r(e,n){if("function"!=typeof e)throw new TypeError(o);return n=a(void 0===n?e.length-1:+n||0,0),function(){for(var t=arguments,r=-1,o=a(t.length-n,0),i=Array(o);++r<o;)i[r]=t[n+r];switch(n){case 0:return e.call(this,i);case 1:return e.call(this,t[0],i);case 2:return e.call(this,t[0],t[1],i)}var s=Array(n+1);for(r=-1;++r<n;)s[r]=t[r];return s[n]=i,e.apply(this,s)}}var o="Expected a function",a=Math.max;n.exports=r},{}],22:[function(e,n,t){n.exports=e(11)},{"/Users/mrak/Developer/Braintree/card-validator/node_modules/credit-card-type/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.isnative/index.js":11}],23:[function(e,n,t){n.exports=e(12)},{"/Users/mrak/Developer/Braintree/card-validator/node_modules/credit-card-type/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/index.js":12,"lodash.isarguments":24,"lodash.isarray":25,"lodash.isnative":22}],24:[function(e,n,t){n.exports=e(13)},{"/Users/mrak/Developer/Braintree/card-validator/node_modules/credit-card-type/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/node_modules/lodash.isarguments/index.js":13}],25:[function(e,n,t){n.exports=e(10)},{"/Users/mrak/Developer/Braintree/card-validator/node_modules/credit-card-type/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.isarray/index.js":10}],26:[function(e,n,t){function r(e){return!!e&&"object"==typeof e}function o(e){return"number"==typeof e||r(e)&&s.call(e)==a}var a="[object Number]",i=Object.prototype,s=i.toString;n.exports=o},{}],27:[function(e,n,t){function r(e){return!!e&&"object"==typeof e}function o(e){return"string"==typeof e||r(e)&&s.call(e)==a}var a="[object String]",i=Object.prototype,s=i.toString;n.exports=o},{}],28:[function(e,n,t){function r(e,n,t){return s({},{card:e,isPotentiallyValid:n,isValid:t})}function o(e){var n;for(n in e)if(e.hasOwnProperty(n))return!1;return!0}function a(e){var n,t,a,s;if(l(e)&&(e=String(e)),!i(e))return r(null,!1,!1);if(""===e)return r(null,!0,!1);if(e=e.replace(/\-|\s/g,""),!/^\d*$/.test(e))return r(null,!1,!1);if(n=c(e),o(n))return r(null,!1,!1);for(t="unionpay"===n.type?!0:u(e),a=0;a<n.lengths.length;a++)if(n.lengths[a]===e.length)return r(n,t,t);return s=Math.max.apply(null,n.lengths),e.length<s?r(n,!0,!1):r(n,!1,!1)}var i=e("lodash.isstring"),s=e("lodash.assign"),u=e("./luhn-10"),c=e("credit-card-type"),l=e("lodash.isnumber");n.exports=a},{"./luhn-10":33,"credit-card-type":2,"lodash.assign":15,"lodash.isnumber":26,"lodash.isstring":27}],29:[function(e,n,t){function r(e,n){return{isValid:e,isPotentiallyValid:n}}function o(e,n){return n=n||i,a(e)&&/^\d*$/.test(e)?e.length===n?r(!0,!0):e.length<n?r(!1,!0):e.length>n?r(!1,!1):r(!0,!0):r(!1,!1)}var a=e("lodash.isstring"),i=3;n.exports=o},{"lodash.isstring":27}],30:[function(e,n,t){function r(e,n,t,r){return{isValid:e,isPotentiallyValid:n,month:t,year:r}}function o(e){var n,t,o;return u(e)?(e=e.replace(/^(\d\d) (\d\d(\d\d)?)$/,"$1/$2"),n=a(e),t=i(n.month),o=s(n.year),t.isValid&&o.isValid?r(!0,!0,n.month,n.year):t.isPotentiallyValid&&o.isPotentiallyValid?r(!1,!0,null,null):r(!1,!1,null,null)):r(!1,!1,null,null)}var a=e("./parse-date"),i=e("./expiration-month"),s=e("./expiration-year"),u=e("lodash.isstring");n.exports=o},{"./expiration-month":31,"./expiration-year":32,"./parse-date":34,"lodash.isstring":27}],31:[function(e,n,t){function r(e,n){return{isValid:e,isPotentiallyValid:n}}function o(e){var n,t;return a(e)?""===e.replace(/\s/g,"")||"0"===e?r(!1,!0):/^\d*$/.test(e)?(n=parseInt(e,10),isNaN(e)?r(!1,!1):(t=n>0&&13>n,r(t,t))):r(!1,!1):r(!1,!1)}var a=e("lodash.isstring");n.exports=o},{"lodash.isstring":27}],32:[function(e,n,t){function r(e,n){return{isValid:e,isPotentiallyValid:n}}function o(e){var n,t,o,s,u,c;return a(e)?""===e.replace(/\s/g,"")?r(!1,!0):/^\d*$/.test(e)?(s=e.length,2>s?r(!1,!0):(t=(new Date).getFullYear(),3===s?(o=e.slice(0,2),n=String(t).slice(0,2),r(!1,o===n)):s>4?r(!1,!1):(e=parseInt(e,10),u=Number(String(t).substr(2,2)),2===s?c=e>=u&&u+i>=e:4===s&&(c=e>=t&&t+i>=e),r(c,c)))):r(!1,!1):r(!1,!1)}var a=e("lodash.isstring"),i=19;n.exports=o},{"lodash.isstring":27}],33:[function(e,n,t){n.exports=function(e,n,t,r,o){for(r=+e[n=e.length-1],o=0;n--;)t=+e[n],r+=++o%2?2*t%10+(t>4):t;return!(r%10)}},{}],34:[function(e,n,t){function r(e){var n,t;return e.match("/")?(e=e.split(/\s*\/\s*/g),{month:e[0],year:e.slice(1).join()}):(t="0"===e[0]||e.length>5||4===e.length||3===e.length?2:1,n=e.substr(0,t),{month:n,year:e.substr(n.length,4)})}n.exports=r},{}],35:[function(e,n,t){function r(e,n){return{isValid:e,isPotentiallyValid:n}}function o(e){return a(e)?e.length<4?r(!1,!0):r(!0,!0):r(!1,!1)}var a=e("lodash.isstring");n.exports=o},{"lodash.isstring":27}]},{},[1])(1)});
!function(n){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.cardValidator=n()}}(function(){return function n(t,e,r){function i(a,s){if(!e[a]){if(!t[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var u=e[a]={exports:{}};t[a][0].call(u.exports,function(n){var e=t[a][1][n];return i(e?e:n)},u,u.exports,n,t,e,r)}return e[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(n,t,e){t.exports={number:n("./src/card-number"),expirationDate:n("./src/expiration-date"),expirationMonth:n("./src/expiration-month"),expirationYear:n("./src/expiration-year"),cvv:n("./src/cvv"),postalCode:n("./src/postal-code")}},{"./src/card-number":41,"./src/cvv":42,"./src/expiration-date":43,"./src/expiration-month":44,"./src/expiration-year":45,"./src/postal-code":48}],2:[function(n,t,e){var r=n("lodash/lang/isString"),i=n("lodash/lang/cloneDeep"),o=[{niceType:"Visa",type:"visa",pattern:"^4\\d*$",gaps:[4,8,12],lengths:[16],code:{name:"CVV",size:3}},{niceType:"MasterCard",type:"master-card",pattern:"^5([1-5]\\d*)?$",gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}},{niceType:"American Express",type:"american-express",pattern:"^3([47]\\d*)?$",isAmex:!0,gaps:[4,10],lengths:[15],code:{name:"CID",size:4}},{niceType:"Diners Club",type:"diners-club",pattern:"^3((0([0-5]\\d*)?)|[689]\\d*)?$",gaps:[4,10],lengths:[14],code:{name:"CVV",size:3}},{niceType:"Discover",type:"discover",pattern:"^6(0|01|011\\d*|5\\d*|4|4[4-9]\\d*)?$",gaps:[4,8,12],lengths:[16],code:{name:"CID",size:3}},{niceType:"JCB",type:"jcb",pattern:"^((2|21|213|2131\\d*)|(1|18|180|1800\\d*)|(3|35\\d*))$",gaps:[4,8,12],lengths:[16],code:{name:"CVV",size:3}},{niceType:"UnionPay",type:"unionpay",pattern:"^6(2\\d*)?$",gaps:[4,8,12],lengths:[16,17,18,19],code:{name:"CVN",size:3}},{niceType:"Maestro",type:"maestro",pattern:"^((5((0|[6-9])\\d*)?)|(6|6[37]\\d*))$",gaps:[4,8,12],lengths:[12,13,14,15,16,17,18,19],code:{name:"CVC",size:3}}];t.exports=function(n){var t,e,a=[];if(!r(n))return a;if(""===n)return i(o);for(t=0;t<o.length;t++)e=o[t],RegExp(e.pattern).test(n)&&a.push(i(e));return a}},{"lodash/lang/cloneDeep":29,"lodash/lang/isString":36}],3:[function(n,t,e){function r(n,t){if("function"!=typeof n)throw new TypeError(i);return t=o(void 0===t?n.length-1:+t||0,0),function(){for(var e=arguments,r=-1,i=o(e.length-t,0),a=Array(i);++r<i;)a[r]=e[t+r];switch(t){case 0:return n.call(this,a);case 1:return n.call(this,e[0],a);case 2:return n.call(this,e[0],e[1],a)}var s=Array(t+1);for(r=-1;++r<t;)s[r]=e[r];return s[t]=a,n.apply(this,s)}}var i="Expected a function",o=Math.max;t.exports=r},{}],4:[function(n,t,e){function r(n,t){var e=-1,r=n.length;for(t||(t=Array(r));++e<r;)t[e]=n[e];return t}t.exports=r},{}],5:[function(n,t,e){function r(n,t){for(var e=-1,r=n.length;++e<r&&t(n[e],e,n)!==!1;);return n}t.exports=r},{}],6:[function(n,t,e){function r(n,t,e){for(var r=-1,o=i(t),a=o.length;++r<a;){var s=o[r],c=n[s],l=e(c,t[s],s,n,t);(l===l?l===c:c!==c)&&(void 0!==c||s in n)||(n[s]=l)}return n}var i=n("../object/keys");t.exports=r},{"../object/keys":38}],7:[function(n,t,e){function r(n,t){return null==t?n:i(t,o(t),n)}var i=n("./baseCopy"),o=n("../object/keys");t.exports=r},{"../object/keys":38,"./baseCopy":9}],8:[function(n,t,e){function r(n,t,e,y,d,b,h){var j;if(e&&(j=d?e(n,y,d):e(n)),void 0!==j)return j;if(!p(n))return n;var x=f(n);if(x){if(j=c(n),!t)return i(n,j)}else{var m=U.call(n),O=m==v;if(m!=A&&m!=g&&(!O||d))return D[m]?l(n,m,t):d?n:{};if(j=u(O?{}:n),!t)return a(j,n)}b||(b=[]),h||(h=[]);for(var C=b.length;C--;)if(b[C]==n)return h[C];return b.push(n),h.push(j),(x?o:s)(n,function(i,o){j[o]=r(i,t,e,o,n,b,h)}),j}var i=n("./arrayCopy"),o=n("./arrayEach"),a=n("./baseAssign"),s=n("./baseForOwn"),c=n("./initCloneArray"),l=n("./initCloneByTag"),u=n("./initCloneObject"),f=n("../lang/isArray"),p=n("../lang/isObject"),g="[object Arguments]",y="[object Array]",d="[object Boolean]",b="[object Date]",h="[object Error]",v="[object Function]",j="[object Map]",x="[object Number]",A="[object Object]",m="[object RegExp]",O="[object Set]",C="[object String]",w="[object WeakMap]",k="[object ArrayBuffer]",V="[object Float32Array]",L="[object Float64Array]",S="[object Int8Array]",I="[object Int16Array]",$="[object Int32Array]",F="[object Uint8Array]",P="[object Uint8ClampedArray]",N="[object Uint16Array]",T="[object Uint32Array]",D={};D[g]=D[y]=D[k]=D[d]=D[b]=D[V]=D[L]=D[S]=D[I]=D[$]=D[x]=D[A]=D[m]=D[C]=D[F]=D[P]=D[N]=D[T]=!0,D[h]=D[v]=D[j]=D[O]=D[w]=!1;var E=Object.prototype,U=E.toString;t.exports=r},{"../lang/isArray":31,"../lang/isObject":35,"./arrayCopy":4,"./arrayEach":5,"./baseAssign":7,"./baseForOwn":11,"./initCloneArray":19,"./initCloneByTag":20,"./initCloneObject":21}],9:[function(n,t,e){function r(n,t,e){e||(e={});for(var r=-1,i=t.length;++r<i;){var o=t[r];e[o]=n[o]}return e}t.exports=r},{}],10:[function(n,t,e){var r=n("./createBaseFor"),i=r();t.exports=i},{"./createBaseFor":16}],11:[function(n,t,e){function r(n,t){return i(n,t,o)}var i=n("./baseFor"),o=n("../object/keys");t.exports=r},{"../object/keys":38,"./baseFor":10}],12:[function(n,t,e){function r(n){return function(t){return null==t?void 0:t[n]}}t.exports=r},{}],13:[function(n,t,e){function r(n,t,e){if("function"!=typeof n)return i;if(void 0===t)return n;switch(e){case 1:return function(e){return n.call(t,e)};case 3:return function(e,r,i){return n.call(t,e,r,i)};case 4:return function(e,r,i,o){return n.call(t,e,r,i,o)};case 5:return function(e,r,i,o,a){return n.call(t,e,r,i,o,a)}}return function(){return n.apply(t,arguments)}}var i=n("../utility/identity");t.exports=r},{"../utility/identity":40}],14:[function(n,t,e){(function(n){function e(n){var t=new r(n.byteLength),e=new i(t);return e.set(new i(n)),t}var r=n.ArrayBuffer,i=n.Uint8Array;t.exports=e}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],15:[function(n,t,e){function r(n){return a(function(t,e){var r=-1,a=null==t?0:e.length,s=a>2?e[a-2]:void 0,c=a>2?e[2]:void 0,l=a>1?e[a-1]:void 0;for("function"==typeof s?(s=i(s,l,5),a-=2):(s="function"==typeof l?l:void 0,a-=s?1:0),c&&o(e[0],e[1],c)&&(s=3>a?void 0:s,a=1);++r<a;){var u=e[r];u&&n(t,u,s)}return t})}var i=n("./bindCallback"),o=n("./isIterateeCall"),a=n("../function/restParam");t.exports=r},{"../function/restParam":3,"./bindCallback":13,"./isIterateeCall":24}],16:[function(n,t,e){function r(n){return function(t,e,r){for(var o=i(t),a=r(t),s=a.length,c=n?s:-1;n?c--:++c<s;){var l=a[c];if(e(o[l],l,o)===!1)break}return t}}var i=n("./toObject");t.exports=r},{"./toObject":28}],17:[function(n,t,e){var r=n("./baseProperty"),i=r("length");t.exports=i},{"./baseProperty":12}],18:[function(n,t,e){function r(n,t){var e=null==n?void 0:n[t];return i(e)?e:void 0}var i=n("../lang/isNative");t.exports=r},{"../lang/isNative":33}],19:[function(n,t,e){function r(n){var t=n.length,e=new n.constructor(t);return t&&"string"==typeof n[0]&&o.call(n,"index")&&(e.index=n.index,e.input=n.input),e}var i=Object.prototype,o=i.hasOwnProperty;t.exports=r},{}],20:[function(n,t,e){function r(n,t,e){var r=n.constructor;switch(t){case u:return i(n);case o:case a:return new r(+n);case f:case p:case g:case y:case d:case b:case h:case v:case j:var A=n.buffer;return new r(e?i(A):A,n.byteOffset,n.length);case s:case l:return new r(n);case c:var m=new r(n.source,x.exec(n));m.lastIndex=n.lastIndex}return m}var i=n("./bufferClone"),o="[object Boolean]",a="[object Date]",s="[object Number]",c="[object RegExp]",l="[object String]",u="[object ArrayBuffer]",f="[object Float32Array]",p="[object Float64Array]",g="[object Int8Array]",y="[object Int16Array]",d="[object Int32Array]",b="[object Uint8Array]",h="[object Uint8ClampedArray]",v="[object Uint16Array]",j="[object Uint32Array]",x=/\w*$/;t.exports=r},{"./bufferClone":14}],21:[function(n,t,e){function r(n){var t=n.constructor;return"function"==typeof t&&t instanceof t||(t=Object),new t}t.exports=r},{}],22:[function(n,t,e){function r(n){return null!=n&&o(i(n))}var i=n("./getLength"),o=n("./isLength");t.exports=r},{"./getLength":17,"./isLength":25}],23:[function(n,t,e){function r(n,t){return n="number"==typeof n||i.test(n)?+n:-1,t=null==t?o:t,n>-1&&n%1==0&&t>n}var i=/^\d+$/,o=9007199254740991;t.exports=r},{}],24:[function(n,t,e){function r(n,t,e){if(!a(e))return!1;var r=typeof t;if("number"==r?i(e)&&o(t,e.length):"string"==r&&t in e){var s=e[t];return n===n?n===s:s!==s}return!1}var i=n("./isArrayLike"),o=n("./isIndex"),a=n("../lang/isObject");t.exports=r},{"../lang/isObject":35,"./isArrayLike":22,"./isIndex":23}],25:[function(n,t,e){function r(n){return"number"==typeof n&&n>-1&&n%1==0&&i>=n}var i=9007199254740991;t.exports=r},{}],26:[function(n,t,e){function r(n){return!!n&&"object"==typeof n}t.exports=r},{}],27:[function(n,t,e){function r(n){for(var t=c(n),e=t.length,r=e&&n.length,l=!!r&&s(r)&&(o(n)||i(n)),f=-1,p=[];++f<e;){var g=t[f];(l&&a(g,r)||u.call(n,g))&&p.push(g)}return p}var i=n("../lang/isArguments"),o=n("../lang/isArray"),a=n("./isIndex"),s=n("./isLength"),c=n("../object/keysIn"),l=Object.prototype,u=l.hasOwnProperty;t.exports=r},{"../lang/isArguments":30,"../lang/isArray":31,"../object/keysIn":39,"./isIndex":23,"./isLength":25}],28:[function(n,t,e){function r(n){return i(n)?n:Object(n)}var i=n("../lang/isObject");t.exports=r},{"../lang/isObject":35}],29:[function(n,t,e){function r(n,t,e){return"function"==typeof t?i(n,!0,o(t,e,3)):i(n,!0)}var i=n("../internal/baseClone"),o=n("../internal/bindCallback");t.exports=r},{"../internal/baseClone":8,"../internal/bindCallback":13}],30:[function(n,t,e){function r(n){return o(n)&&i(n)&&s.call(n,"callee")&&!c.call(n,"callee")}var i=n("../internal/isArrayLike"),o=n("../internal/isObjectLike"),a=Object.prototype,s=a.hasOwnProperty,c=a.propertyIsEnumerable;t.exports=r},{"../internal/isArrayLike":22,"../internal/isObjectLike":26}],31:[function(n,t,e){var r=n("../internal/getNative"),i=n("../internal/isLength"),o=n("../internal/isObjectLike"),a="[object Array]",s=Object.prototype,c=s.toString,l=r(Array,"isArray"),u=l||function(n){return o(n)&&i(n.length)&&c.call(n)==a};t.exports=u},{"../internal/getNative":18,"../internal/isLength":25,"../internal/isObjectLike":26}],32:[function(n,t,e){function r(n){return i(n)&&s.call(n)==o}var i=n("./isObject"),o="[object Function]",a=Object.prototype,s=a.toString;t.exports=r},{"./isObject":35}],33:[function(n,t,e){function r(n){return null==n?!1:i(n)?u.test(c.call(n)):o(n)&&a.test(n)}var i=n("./isFunction"),o=n("../internal/isObjectLike"),a=/^\[object .+?Constructor\]$/,s=Object.prototype,c=Function.prototype.toString,l=s.hasOwnProperty,u=RegExp("^"+c.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=r},{"../internal/isObjectLike":26,"./isFunction":32}],34:[function(n,t,e){function r(n){return"number"==typeof n||i(n)&&s.call(n)==o}var i=n("../internal/isObjectLike"),o="[object Number]",a=Object.prototype,s=a.toString;t.exports=r},{"../internal/isObjectLike":26}],35:[function(n,t,e){function r(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}t.exports=r},{}],36:[function(n,t,e){function r(n){return"string"==typeof n||i(n)&&s.call(n)==o}var i=n("../internal/isObjectLike"),o="[object String]",a=Object.prototype,s=a.toString;t.exports=r},{"../internal/isObjectLike":26}],37:[function(n,t,e){var r=n("../internal/assignWith"),i=n("../internal/baseAssign"),o=n("../internal/createAssigner"),a=o(function(n,t,e){return e?r(n,t,e):i(n,t)});t.exports=a},{"../internal/assignWith":6,"../internal/baseAssign":7,"../internal/createAssigner":15}],38:[function(n,t,e){var r=n("../internal/getNative"),i=n("../internal/isArrayLike"),o=n("../lang/isObject"),a=n("../internal/shimKeys"),s=r(Object,"keys"),c=s?function(n){var t=null==n?void 0:n.constructor;return"function"==typeof t&&t.prototype===n||"function"!=typeof n&&i(n)?a(n):o(n)?s(n):[]}:a;t.exports=c},{"../internal/getNative":18,"../internal/isArrayLike":22,"../internal/shimKeys":27,"../lang/isObject":35}],39:[function(n,t,e){function r(n){if(null==n)return[];c(n)||(n=Object(n));var t=n.length;t=t&&s(t)&&(o(n)||i(n))&&t||0;for(var e=n.constructor,r=-1,l="function"==typeof e&&e.prototype===n,f=Array(t),p=t>0;++r<t;)f[r]=r+"";for(var g in n)p&&a(g,t)||"constructor"==g&&(l||!u.call(n,g))||f.push(g);return f}var i=n("../lang/isArguments"),o=n("../lang/isArray"),a=n("../internal/isIndex"),s=n("../internal/isLength"),c=n("../lang/isObject"),l=Object.prototype,u=l.hasOwnProperty;t.exports=r},{"../internal/isIndex":23,"../internal/isLength":25,"../lang/isArguments":30,"../lang/isArray":31,"../lang/isObject":35}],40:[function(n,t,e){function r(n){return n}t.exports=r},{}],41:[function(n,t,e){function r(n,t,e){return a({},{card:n,isPotentiallyValid:t,isValid:e})}function i(n){var t,e,i,a,u;if(l(n)&&(n=String(n)),!o(n))return r(null,!1,!1);if(n=n.replace(/\-|\s/g,""),!/^\d*$/.test(n))return r(null,!1,!1);if(t=c(n),0===t.length)return r(null,!1,!1);if(1!==t.length)return r(null,!0,!1);for(e=t[0],i="unionpay"===e.type?!0:s(n),a=0;a<e.lengths.length;a++)if(e.lengths[a]===n.length)return r(e,i,i);return u=Math.max.apply(null,e.lengths),n.length<u?r(e,!0,!1):r(e,!1,!1)}var o=n("lodash/lang/isString"),a=n("lodash/object/assign"),s=n("./luhn-10"),c=n("credit-card-type"),l=n("lodash/lang/isNumber");t.exports=i},{"./luhn-10":46,"credit-card-type":2,"lodash/lang/isNumber":34,"lodash/lang/isString":36,"lodash/object/assign":37}],42:[function(n,t,e){function r(n,t){for(var e=0;e<n.length;e++)if(t===n[e])return!0;return!1}function i(n){for(var t=l,e=0;e<n.length;e++)t=n[e]<t?n[e]:t;return t}function o(n){for(var t=l,e=0;e<n.length;e++)t=n[e]>t?n[e]:t;return t}function a(n,t){return{isValid:n,isPotentiallyValid:t}}function s(n,t){return t=t||l,t=t instanceof Array?t:[t],c(n)&&/^\d*$/.test(n)?r(t,n.length)?a(!0,!0):n.length<i(t)?a(!1,!0):n.length>o(t)?a(!1,!1):a(!0,!0):a(!1,!1)}var c=n("lodash/lang/isString"),l=3;t.exports=s},{"lodash/lang/isString":36}],43:[function(n,t,e){function r(n,t,e,r){return{isValid:n,isPotentiallyValid:t,month:e,year:r}}function i(n){var t,e,i,l;if(!c(n))return r(!1,!1,null,null);if(n=n.replace(/^(\d\d) (\d\d(\d\d)?)$/,"$1/$2"),t=o(n),e=a(t.month),i=s(t.year),i.isValid){if(i.isCurrentYear)return l=e.isValidForThisYear,r(l,l,t.month,t.year);if(e.isValid)return r(!0,!0,t.month,t.year)}return e.isPotentiallyValid&&i.isPotentiallyValid?r(!1,!0,null,null):r(!1,!1,null,null)}var o=n("./parse-date"),a=n("./expiration-month"),s=n("./expiration-year"),c=n("lodash/lang/isString");t.exports=i},{"./expiration-month":44,"./expiration-year":45,"./parse-date":47,"lodash/lang/isString":36}],44:[function(n,t,e){function r(n,t,e){return{isValid:n,isPotentiallyValid:t,isValidForThisYear:e||!1}}function i(n){var t,e,i=(new Date).getMonth()+1;return o(n)?""===n.replace(/\s/g,"")||"0"===n?r(!1,!0):/^\d*$/.test(n)?(t=parseInt(n,10),isNaN(n)?r(!1,!1):(e=t>0&&13>t,r(e,e,e&&t>=i))):r(!1,!1):r(!1,!1)}var o=n("lodash/lang/isString");t.exports=i},{"lodash/lang/isString":36}],45:[function(n,t,e){function r(n,t,e){return{isValid:n,isPotentiallyValid:t,isCurrentYear:e||!1}}function i(n){var t,e,i,s,c,l,u;return o(n)?""===n.replace(/\s/g,"")?r(!1,!0):/^\d*$/.test(n)?(s=n.length,2>s?r(!1,!0):(e=(new Date).getFullYear(),3===s?(i=n.slice(0,2),t=String(e).slice(0,2),r(!1,i===t)):s>4?r(!1,!1):(n=parseInt(n,10),c=Number(String(e).substr(2,2)),2===s?(u=c===n,l=n>=c&&c+a>=n):4===s&&(u=e===n,l=n>=e&&e+a>=n),r(l,l,u)))):r(!1,!1):r(!1,!1)}var o=n("lodash/lang/isString"),a=19;t.exports=i},{"lodash/lang/isString":36}],46:[function(n,t,e){t.exports=function(n,t,e,r,i){for(r=+n[t=n.length-1],i=0;t--;)e=+n[t],r+=++i%2?2*e%10+(e>4):e;return!(r%10)}},{}],47:[function(n,t,e){function r(n){var t,e;return n.match("/")?(n=n.split(/\s*\/\s*/g),{month:n[0],year:n.slice(1).join()}):(e="0"===n[0]||n.length>5||4===n.length||3===n.length?2:1,t=n.substr(0,e),{month:t,year:n.substr(t.length,4)})}t.exports=r},{}],48:[function(n,t,e){function r(n,t){return{isValid:n,isPotentiallyValid:t}}function i(n){return o(n)?n.length<4?r(!1,!0):r(!0,!0):r(!1,!1)}var o=n("lodash/lang/isString");t.exports=i},{"lodash/lang/isString":36}]},{},[1])(1)});
{
"name": "card-validator",
"version": "2.2.0",
"version": "2.2.1",
"description": "A library for validating credit card fields",

@@ -28,10 +28,3 @@ "main": "index.js",

"gulp-watch": "^0.6.8",
"karma": "^0.12.31",
"karma-browserify": "^4.0.0",
"karma-chai-sinon": "^0.1.4",
"karma-es5-shim": "0.0.4",
"karma-mocha": "^0.1.10",
"karma-phantomjs-launcher": "^0.1.4",
"mocha": "^2.2.1",
"phantomjs": "^1.9.16",
"sinon": "^1.14.1",

@@ -43,6 +36,4 @@ "sinon-chai": "^2.7.0",

"credit-card-type": "^4.0.0",
"lodash.assign": "^3.0.0",
"lodash.isnumber": "^3.0.1",
"lodash.isstring": "^3.0.1"
"lodash": "3.10.1"
}
}

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

var isString = require('lodash.isstring');
var extend = require('lodash.assign');
var isString = require('lodash/lang/isString');
var extend = require('lodash/object/assign');
var luhn10 = require('./luhn-10');
var getCardTypes = require('credit-card-type');
var isNumber = require('lodash.isnumber');
var isNumber = require('lodash/lang/isNumber');

@@ -7,0 +7,0 @@ function verification(card, isPotentiallyValid, isValid) {

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

var isString = require('lodash.isstring');
var isString = require('lodash/lang/isString');
var DEFAULT_LENGTH = 3;

@@ -3,0 +3,0 @@

var parseDate = require('./parse-date');
var expirationMonth = require('./expiration-month');
var expirationYear = require('./expiration-year');
var isString = require('lodash.isstring');
var isString = require('lodash/lang/isString');

@@ -6,0 +6,0 @@ function verification(isValid, isPotentiallyValid, month, year) {

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

var isString = require('lodash.isstring');
var isString = require('lodash/lang/isString');

@@ -3,0 +3,0 @@ function verification(isValid, isPotentiallyValid, isValidForThisYear) {

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

var isString = require('lodash.isstring');
var isString = require('lodash/lang/isString');
var maxYear = 19;

@@ -3,0 +3,0 @@

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

var isString = require('lodash.isstring');
var isString = require('lodash/lang/isString');

@@ -3,0 +3,0 @@ function verification(isValid, isPotentiallyValid) {

Sorry, the diff of this file is too big to display

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