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 0.3.4 to 0.3.5

20

lib/expression.js

@@ -433,2 +433,22 @@ 'use strict';

/**
* Check if next suitable date exists
*
* @public
* @return {Boolean}
*/
CronExpression.prototype.hasNext = function() {
var memorized = this._currentDate;
try {
this.next();
return true;
}
catch(error) {
return false;
}
finally {
this._currentDate = memorized;
}
};
/**
* Iterate over expression iterator

@@ -435,0 +455,0 @@ *

5

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

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

"Meaglin Wasabi <Meaglin.wasabi@gmail.com>",
"Mike Kusold <hello@mikekusold.com>"
"Mike Kusold <hello@mikekusold.com>",
"Alex Kit <alex.kit@atmajs.com>"
],

@@ -29,0 +30,0 @@ "license": "MIT",

16

test/parser.js

@@ -19,2 +19,3 @@ var util = require('util');

t.equal(result.expressions[0].hasNext(), true);
next = result.expressions[0].next();

@@ -31,2 +32,15 @@ t.ok(next, 'first date');

});
});
});
test('no next date', function(t){
var options = {
currentDate: new Date(2014, 0, 1),
endDate: new Date(2014, 0, 1)
};
CronParser.parseExpression('* * 2 * *', options, function(err, interval) {
t.ifError(err, 'Parse read error');
t.equal(interval.hasNext(), false);
t.end();
});
})

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