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 2.14.0 to 2.15.0

3

lib/expression.js

@@ -286,2 +286,5 @@ 'use strict';

if (atoms.length > 1) {
if (atoms[0] == +atoms[0]) {
atoms = [atoms[0] + '-' + constraints[1], atoms[1]];
}
return parseRange(atoms[0], atoms[atoms.length - 1]);

@@ -288,0 +291,0 @@ }

2

package.json
{
"name": "cron-parser",
"version": "2.14.0",
"version": "2.15.0",
"description": "Node.js library for parsing crontab instructions",

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

@@ -286,2 +286,43 @@ var test = require('tap').test;

test('range test with value and repeat (second)', function(t) {
var options = {
currentDate: new CronDate('Wed, 26 Dec 2012 14:38:53')
};
var interval = CronExpression.parse('0/30 * * * * ?', options);
t.ok(interval, 'Interval parsed');
var next = interval.next();
t.equal(next.getSeconds(), 0);
next = interval.next();
t.equal(next.getSeconds(), 30);
next = interval.next();
t.equal(next.getSeconds(), 0);
t.end();
});
test('range test with value and repeat (minute)', function(t) {
var options = {
currentDate: new CronDate('Wed, 26 Dec 2012 14:38:53')
};
var interval = CronExpression.parse('6/23 * * * *', options);
t.ok(interval, 'Interval parsed');
var next = interval.next();
t.equal(next.getMinutes(), 52);
next = interval.next();
t.equal(next.getMinutes(), 6);
next = interval.next();
t.equal(next.getMinutes(), 29);
next = interval.next();
t.equal(next.getMinutes(), 52);
t.end();
});
test('range test with iterator', function(t) {

@@ -973,3 +1014,6 @@ try {

test('should sort ranges and values in ascending order', function(t) {
var interval = CronExpression.parse('0 12,13,10,1-3 * * *');
var options = {
currentDate: new CronDate('Wed, 26 Dec 2012 14:38:53')
};
var interval = CronExpression.parse('0 12,13,10,1-3 * * *', options);
t.ok(interval, 'Interval parsed');

@@ -976,0 +1020,0 @@

Sorry, the diff of this file is not supported yet

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