New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

month-days

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

month-days - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

14

index.js
'use strict';
const isDefined = x => x !== null && x !== undefined;
module.exports = (month, year) => {
if (isDefined(month) && typeof month !== 'number') {
throw new TypeError(`Expected \`month\` to be of type \`number\`, got \`${typeof month}\``);
}
if (isDefined(year) && typeof year !== 'number') {
throw new TypeError(`Expected \`year\` to be of type \`number\`, got \`${typeof year}\``);
}
const now = new Date();
month = (month === null || month === undefined) ? now.getUTCMonth() : month;
year = (year === null || year === undefined) ? now.getUTCFullYear() : year;
month = isDefined(month) ? month : now.getUTCMonth();
year = isDefined(year) ? year : now.getUTCFullYear();
return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();
};

2

package.json
{
"name": "month-days",
"version": "2.0.0",
"version": "2.1.0",
"description": "Get the number of days in a month",

@@ -5,0 +5,0 @@ "license": "MIT",

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