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

cron-parser

Package Overview
Dependencies
Maintainers
1
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cron-parser - npm Package Compare versions

Comparing version 4.5.0 to 4.6.0

4

lib/expression.js

@@ -809,3 +809,5 @@ 'use strict';

var value = this.fields[field];
var constraint = CronExpression.constraints[i];
var constraint = field === 'dayOfMonth' && this.fields.month.length === 1
? { min: 1, max: CronExpression.daysInMonth[this.fields.month[0] - 1] }
: CronExpression.constraints[i];
resultArr.push(stringifyField(value, constraint.min, constraint.max));

@@ -812,0 +814,0 @@ }

{
"name": "cron-parser",
"version": "4.5.0",
"version": "4.6.0",
"description": "Node.js library for parsing crontab instructions",

@@ -59,3 +59,3 @@ "main": "lib/parser.js",

"dependencies": {
"luxon": "^2.4.0"
"luxon": "^3.0.1"
},

@@ -62,0 +62,0 @@ "devDependencies": {

@@ -261,2 +261,45 @@ 'use strict';

test('stringify cron expression with wildcard day of month and single month value', function (t) {
try {
var expected = '* * * 4 *';
var interval = CronParser.parseExpression(expected, {});
var str = interval.stringify();
t.equal(str, expected);
} catch (err) {
t.error(err, 'Parse read error');
}
t.end();
});
test('stringify cron expression with wildcard day of month and month rangee', function (t) {
try {
var expected = '* * * 4-6 *';
var interval = CronParser.parseExpression(expected, {});
var str = interval.stringify();
t.equal(str, expected);
} catch (err) {
t.error(err, 'Parse read error');
}
t.end();
});
test('stringify cron expression with day of month range and single month value', function (t) {
try {
var expected = '* * 1-25 4 *';
var interval = CronParser.parseExpression(expected, {});
var str = interval.stringify();
t.equal(str, expected);
} catch (err) {
t.error(err, 'Parse read error');
}
t.end();
});
test('stringify from fields out of order', function (t) {

@@ -263,0 +306,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