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.3 to 0.3.4

3

lib/expression.js

@@ -114,3 +114,4 @@ 'use strict';

value = value.replace(/^[a-z]{1,3}$/gi, function(match) {
value = value.replace(/[a-z]{1,3}/gi, function(match) {
match = match.toLowerCase();
if (aliases[match]) {

@@ -117,0 +118,0 @@ return aliases[match];

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

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

@@ -320,1 +320,48 @@ var util = require('util');

test('expression using days of week strings', function(t) {
CronExpression.parse('15 10 * * MON-TUE', function(err, interval) {
t.ifError(err, 'Interval parse error');
t.ok(interval, 'Interval parsed');
var intervals = interval.iterate(8);
t.ok(intervals, 'Found intervals');
for (var i = 0, c = intervals.length; i < c; i++) {
var next = intervals[i];
var day = next.getDay();
t.ok(next, 'Found next scheduled interval');
t.ok(day == 1 || day == 2, "Day matches")
t.equal(next.getHours(), 10, 'Hour matches');
t.equal(next.getMinutes(), 15, 'Minute matches');
}
t.end();
});
});
test('expression using mixed days of week strings', function(t) {
CronExpression.parse('15 10 * jAn-FeB mOn-tUE', function(err, interval) {
t.ifError(err, 'Interval parse error');
t.ok(interval, 'Interval parsed');
var intervals = interval.iterate(8);
t.ok(intervals, 'Found intervals');
for (var i = 0, c = intervals.length; i < c; i++) {
var next = intervals[i];
var day = next.getDay();
var month = next.getMonth();
t.ok(next, 'Found next scheduled interval');
t.ok(month == 0 || month == 2, "Month Matches");
t.ok(day == 1 || day == 2, "Day matches");
t.equal(next.getHours(), 10, 'Hour matches');
t.equal(next.getMinutes(), 15, 'Minute matches');
}
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