cron-parser
Advanced tools
Comparing version 4.5.0 to 4.6.0
@@ -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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
148229
4220
+ Addedluxon@3.5.0(transitive)
- Removedluxon@2.5.2(transitive)
Updatedluxon@^3.0.1