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

dosh

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dosh - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

21

lib/index.js

@@ -15,2 +15,3 @@ "use strict";

exports.validateExpiryMonth = validateExpiryMonth;
exports.formatNumber = formatNumber;

@@ -26,3 +27,4 @@ var _lodashCollectionFind = require("lodash/collection/find");

validateExpiryYear: validateExpiryYear,
validateExpiryMonth: validateExpiryMonth
validateExpiryMonth: validateExpiryMonth,
formatNumber: formatNumber
};

@@ -53,2 +55,3 @@

pattern: /^5019/,
length: [16],
cvcLength: [3],

@@ -181,3 +184,3 @@ luhn: true

// Remove all extra characters from the string
return ("" + text).replace(/[\. ,:-]+/g, "");
return ("" + text).replace(/\D/g, "");
}

@@ -205,3 +208,3 @@

// Everything seems to check out return the card type
return card.type;
return card;
}

@@ -245,2 +248,14 @@

return true;
}
function formatNumber(value) {
var text = cleanNumber(value);
var card = match(text);
// 16-digit cards can be easily formatted
if (card != null && card.length.indexOf(16) >= 0 && text.length <= 16) {
text = text.replace(/(\d{4})/g, "$1 ").trim();
}
return text;
}

3

package.json
{
"name": "dosh",
"version": "0.2.0",
"version": "0.3.0",
"description": "",

@@ -16,2 +16,3 @@ "main": "lib/index.js",

"dependencies": {
"babel-runtime": "^5.8.25",
"lodash": "^3.10.1"

@@ -18,0 +19,0 @@ },

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