Socket
Socket
Sign inDemoInstall

credit-card

Package Overview
Dependencies
1
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 1.1.1

4

lib/index.js

@@ -153,3 +153,5 @@ var Hoek = require('hoek');

var expiration = new Date(year, month - 1);
// cards are good until the end of the month
// http://stackoverflow.com/questions/54037/credit-card-expiration-dates-inclusive-or-exclusive
var expiration = new Date(year, month);

@@ -156,0 +158,0 @@ return Date.now() >= expiration;

{
"name": "credit-card",
"version": "1.1.0",
"version": "1.1.1",
"description": "credit card validation",

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

@@ -390,2 +390,17 @@ var Lab = require('lab');

});
it('returns true when card expired last month', function(done) {
var date = new Date();
date.setMonth(date.getMonth() - 1); // last month
expect(CreditCard.isExpired(date.getMonth() + 1, date.getFullYear())).to.equal(true);
done();
});
it('returns false when card expires this month', function(done) {
var date = new Date();
expect(CreditCard.isExpired(date.getMonth() + 1, date.getFullYear())).to.equal(false);
done();
});
});

@@ -392,0 +407,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc