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.3.0 to 4.4.0

2

lib/expression.js

@@ -575,3 +575,3 @@ 'use strict';

// Add or subtract day if select day not match with month (according to calendar)
if (!dayOfMonthMatch && !dayOfWeekMatch) {
if (!dayOfMonthMatch && (!dayOfWeekMatch || isDayOfWeekWildcardMatch)) {
this._applyTimezoneShift(currentDate, dateMathVerb, 'Day');

@@ -578,0 +578,0 @@ continue;

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

@@ -5,0 +5,0 @@ "main": "lib/parser.js",

@@ -922,2 +922,48 @@ var test = require('tap').test;

test('day of month contains multiple ranges and day of week is wildcard', function(t) {
try {
var options = {
currentDate: new CronDate('Sat, 1 Dec 2012 14:38:53')
};
var interval = CronExpression.parse('0 0 0 2-4,7-31 * *', options);
t.ok(interval, 'Interval parsed');
var next = interval.next();
t.ok(next, 'Found next scheduled interval');
t.ok(next.getDate() === 2, 'Day of month matches');
t.equal(next.getMonth(), 11, 'Month matches');
next = interval.next();
t.ok(next, 'Found next scheduled interval');
t.ok(next.getDate() === 3, 'Day of month matches');
t.equal(next.getMonth(), 11, 'Month matches');
next = interval.next();
t.ok(next, 'Found next scheduled interval');
t.ok(next.getDate() === 4, 'Day of month matches');
t.equal(next.getMonth(), 11, 'Month matches');
next = interval.next();
t.ok(next, 'Found next scheduled interval');
t.ok(next.getDate() === 7, 'Day of month matches');
t.equal(next.getMonth(), 11, 'Month matches');
next = interval.next();
t.ok(next, 'Found next scheduled interval');
t.ok(next.getDate() === 8, 'Day of month matches');
t.equal(next.getMonth(), 11, 'Month matches');
next = interval.next();
} catch (err) {
t.error(err, 'Interval parse error');
}
t.end();
});
test('day of month and week are both set and dow is 6,0', function(t) {

@@ -962,3 +1008,3 @@ try {

test('day of month and week are both set and dow is 6-7', function(t) {
test('day of month and week are both set and dow is a range with value 6-7', function(t) {
try {

@@ -965,0 +1011,0 @@ var options = {

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