From a15ee0adc9d3c973c141982b93cf7e5547284563 Mon Sep 17 00:00:00 2001 From: buzzinJohnnyBoi Date: Sat, 11 May 2024 08:11:28 -0400 Subject: [PATCH 1/2] Resolve interval handling when startAt set in the past --- src/croner.js | 14 +++++++++++++- test/node/js/src/suites/options.cjs | 21 +++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/croner.js b/src/croner.js index a9813f5..1fcf69c 100644 --- a/src/croner.js +++ b/src/croner.js @@ -496,7 +496,19 @@ Cron.prototype._checkTrigger = function (target) { * @returns {CronDate | null} - Next run time */ Cron.prototype._next = function (prev) { - const hasPreviousRun = (prev || this._states.currentRun) ? true : false; + let hasPreviousRun = (prev || this._states.currentRun) ? true : false; + + // If no previous run, and startAt and interval is set, calculate when the last run should have been + if (!prev && this.options.startAt && this.options.interval) { + prev = this.options.startAt; + const now = new CronDate(undefined, this.options.timezone || this.options.utcOffset); + let prevTimePlusInterval = prev.getTime() + this.options.interval * 1000; + while (prevTimePlusInterval <= now.getTime()) { + prev = new CronDate(prev, this.options.timezone || this.options.utcOffset).increment(this._states.pattern, this.options, true); + prevTimePlusInterval = prev.getTime() + this.options.interval * 1000; + } + hasPreviousRun = true; + } // Ensure previous run is a CronDate prev = new CronDate(prev, this.options.timezone || this.options.utcOffset); diff --git a/test/node/js/src/suites/options.cjs b/test/node/js/src/suites/options.cjs index 6e39107..c6638d7 100644 --- a/test/node/js/src/suites/options.cjs +++ b/test/node/js/src/suites/options.cjs @@ -260,4 +260,25 @@ module.exports = function (Cron, test) { assert.equal(nextRuns.length,5); }); + test("Valid interval starting in the past should give correct start date", function () { + const now = new Date(); + + const yesterday = new Date(now); + yesterday.setDate(now.getDate() - 1); + yesterday.setHours(19, 31, 2); + + const sixDaysFromNow = new Date(now); + sixDaysFromNow.setDate(now.getDate() + 6); + sixDaysFromNow.setHours(19, 31, 2); + + const nextRun = Cron("* * * * * *", { interval: 60 * 60 * 24 * 7, startAt: yesterday.toISOString() }).nextRun(); + + assert.equal(nextRun.getFullYear(), sixDaysFromNow.getFullYear()); + assert.equal(nextRun.getMonth(), sixDaysFromNow.getMonth()); + assert.equal(nextRun.getDate(), sixDaysFromNow.getDate()); + assert.equal(nextRun.getHours(), sixDaysFromNow.getHours()); + assert.equal(nextRun.getMinutes(), sixDaysFromNow.getMinutes()); + assert.equal(nextRun.getSeconds(), sixDaysFromNow.getSeconds()); + }); + }; \ No newline at end of file From d672f8c5a5dc1ce2a1be4f07e9a077fe6386b811 Mon Sep 17 00:00:00 2001 From: buzzinJohnnyBoi Date: Sat, 11 May 2024 09:19:44 -0400 Subject: [PATCH 2/2] Resolve interval handling when startAt set in the past - run build --- dist/croner.cjs | 14 ++- dist/croner.js | 14 ++- dist/croner.min.cjs | 2 +- dist/croner.min.cjs.map | 2 +- dist/croner.min.js | 2 +- dist/croner.min.js.map | 2 +- dist/croner.umd.js | 14 ++- dist/croner.umd.min.js | 2 +- dist/croner.umd.min.js.map | 2 +- package-lock.json | 176 ++++++++++++++++++++----------------- 10 files changed, 140 insertions(+), 90 deletions(-) diff --git a/dist/croner.cjs b/dist/croner.cjs index 98e221b..0ab4168 100644 --- a/dist/croner.cjs +++ b/dist/croner.cjs @@ -1824,7 +1824,19 @@ Cron.prototype._checkTrigger = function (target) { * @returns {CronDate | null} - Next run time */ Cron.prototype._next = function (prev) { - const hasPreviousRun = (prev || this._states.currentRun) ? true : false; + let hasPreviousRun = (prev || this._states.currentRun) ? true : false; + + // If no previous run, and startAt and interval is set, calculate when the last run should have been + if (!prev && this.options.startAt && this.options.interval) { + prev = this.options.startAt; + const now = new CronDate(undefined, this.options.timezone || this.options.utcOffset); + let prevTimePlusInterval = prev.getTime() + this.options.interval * 1000; + while (prevTimePlusInterval <= now.getTime()) { + prev = new CronDate(prev, this.options.timezone || this.options.utcOffset).increment(this._states.pattern, this.options, true); + prevTimePlusInterval = prev.getTime() + this.options.interval * 1000; + } + hasPreviousRun = true; + } // Ensure previous run is a CronDate prev = new CronDate(prev, this.options.timezone || this.options.utcOffset); diff --git a/dist/croner.js b/dist/croner.js index bd0b807..294902c 100644 --- a/dist/croner.js +++ b/dist/croner.js @@ -1822,7 +1822,19 @@ Cron.prototype._checkTrigger = function (target) { * @returns {CronDate | null} - Next run time */ Cron.prototype._next = function (prev) { - const hasPreviousRun = (prev || this._states.currentRun) ? true : false; + let hasPreviousRun = (prev || this._states.currentRun) ? true : false; + + // If no previous run, and startAt and interval is set, calculate when the last run should have been + if (!prev && this.options.startAt && this.options.interval) { + prev = this.options.startAt; + const now = new CronDate(undefined, this.options.timezone || this.options.utcOffset); + let prevTimePlusInterval = prev.getTime() + this.options.interval * 1000; + while (prevTimePlusInterval <= now.getTime()) { + prev = new CronDate(prev, this.options.timezone || this.options.utcOffset).increment(this._states.pattern, this.options, true); + prevTimePlusInterval = prev.getTime() + this.options.interval * 1000; + } + hasPreviousRun = true; + } // Ensure previous run is a CronDate prev = new CronDate(prev, this.options.timezone || this.options.utcOffset); diff --git a/dist/croner.min.cjs b/dist/croner.min.cjs index 8ac4ca1..a3027f8 100644 --- a/dist/croner.min.cjs +++ b/dist/croner.min.cjs @@ -1 +1 @@ -"use strict";function minitz(y,m,d,h,i,s,tz,throwOnInvalid){return minitz.fromTZ(minitz.tp(y,m,d,h,i,s,tz),throwOnInvalid)}minitz.fromTZISO=(localTimeStr,tz,throwOnInvalid)=>{return minitz.fromTZ(parseISOLocal(localTimeStr,tz),throwOnInvalid)};minitz.fromTZ=function(tp,throwOnInvalid){const inDate=new Date(Date.UTC(tp.y,tp.m-1,tp.d,tp.h,tp.i,tp.s)),offset=getTimezoneOffset(tp.tz,inDate),dateGuess=new Date(inDate.getTime()-offset),dateOffsGuess=getTimezoneOffset(tp.tz,dateGuess);if(dateOffsGuess-offset===0){return dateGuess}else{const dateGuess2=new Date(inDate.getTime()-dateOffsGuess),dateOffsGuess2=getTimezoneOffset(tp.tz,dateGuess2);if(dateOffsGuess2-dateOffsGuess===0){return dateGuess2}else if(!throwOnInvalid&&dateOffsGuess2-dateOffsGuess>0){return dateGuess2}else if(!throwOnInvalid){return dateGuess}else{throw new Error("Invalid date passed to fromTZ()")}}};minitz.toTZ=function(d,tzStr){const localDateString=d.toLocaleString("en-US",{timeZone:tzStr}).replace(/[\u202f]/," ");const td=new Date(localDateString);return{y:td.getFullYear(),m:td.getMonth()+1,d:td.getDate(),h:td.getHours(),i:td.getMinutes(),s:td.getSeconds(),tz:tzStr}};minitz.tp=(y,m,d,h,i,s,tz)=>{return{y:y,m:m,d:d,h:h,i:i,s:s,tz:tz}};function getTimezoneOffset(timeZone,date=new Date){const tz=date.toLocaleString("en-US",{timeZone:timeZone,timeZoneName:"shortOffset"}).split(" ").slice(-1)[0];const dateString=date.toLocaleString("en-US").replace(/[\u202f]/," ");return Date.parse(`${dateString} GMT`)-Date.parse(`${dateString} ${tz}`)}function parseISOLocal(dtStr,tz){const pd=new Date(Date.parse(dtStr));if(isNaN(pd)){throw new Error("minitz: Invalid ISO8601 passed to parser.")}const stringEnd=dtStr.substring(9);if(dtStr.includes("Z")||stringEnd.includes("-")||stringEnd.includes("+")){return minitz.tp(pd.getUTCFullYear(),pd.getUTCMonth()+1,pd.getUTCDate(),pd.getUTCHours(),pd.getUTCMinutes(),pd.getUTCSeconds(),"Etc/UTC")}else{return minitz.tp(pd.getFullYear(),pd.getMonth()+1,pd.getDate(),pd.getHours(),pd.getMinutes(),pd.getSeconds(),tz)}}minitz.minitz=minitz;function CronOptions(options){if(options===void 0){options={}}delete options.name;options.legacyMode=options.legacyMode===void 0?true:options.legacyMode;options.paused=options.paused===void 0?false:options.paused;options.maxRuns=options.maxRuns===void 0?Infinity:options.maxRuns;options.catch=options.catch===void 0?false:options.catch;options.interval=options.interval===void 0?0:parseInt(options.interval,10);options.utcOffset=options.utcOffset===void 0?void 0:parseInt(options.utcOffset,10);options.unref=options.unref===void 0?false:options.unref;if(options.startAt){options.startAt=new CronDate(options.startAt,options.timezone)}if(options.stopAt){options.stopAt=new CronDate(options.stopAt,options.timezone)}if(options.interval!==null){if(isNaN(options.interval)){throw new Error("CronOptions: Supplied value for interval is not a number")}else if(options.interval<0){throw new Error("CronOptions: Supplied value for interval can not be negative")}}if(options.utcOffset!==void 0){if(isNaN(options.utcOffset)){throw new Error("CronOptions: Invalid value passed for utcOffset, should be number representing minutes offset from UTC.")}else if(options.utcOffset<-870||options.utcOffset>870){throw new Error("CronOptions: utcOffset out of bounds.")}if(options.utcOffset!==void 0&&options.timezone){throw new Error("CronOptions: Combining 'utcOffset' with 'timezone' is not allowed.")}}if(options.unref!==true&&options.unref!==false){throw new Error("CronOptions: Unref should be either true, false or undefined(false).")}return options}const LAST_OCCURRENCE=32;const ANY_OCCURRENCE=1|2|4|8|16|LAST_OCCURRENCE;const OCCURRENCE_BITMASKS=[1,2,4,16,16];function CronPattern(pattern,timezone){this.pattern=pattern;this.timezone=timezone;this.second=Array(60).fill(0);this.minute=Array(60).fill(0);this.hour=Array(24).fill(0);this.day=Array(31).fill(0);this.month=Array(12).fill(0);this.dayOfWeek=Array(7).fill(0);this.lastDayOfMonth=false;this.starDOM=false;this.starDOW=false;this.parse()}CronPattern.prototype.parse=function(){if(!(typeof this.pattern==="string"||this.pattern.constructor===String)){throw new TypeError("CronPattern: Pattern has to be of type string.")}if(this.pattern.indexOf("@")>=0)this.pattern=this.handleNicknames(this.pattern).trim();const parts=this.pattern.replace(/\s+/g," ").split(" ");if(parts.length<5||parts.length>6){throw new TypeError("CronPattern: invalid configuration format ('"+this.pattern+"'), exactly five or six space separated parts are required.")}if(parts.length===5){parts.unshift("0")}if(parts[3].indexOf("L")>=0){parts[3]=parts[3].replace("L","");this.lastDayOfMonth=true}if(parts[3]=="*"){this.starDOM=true}if(parts[4].length>=3)parts[4]=this.replaceAlphaMonths(parts[4]);if(parts[5].length>=3)parts[5]=this.replaceAlphaDays(parts[5]);if(parts[5]=="*"){this.starDOW=true}if(this.pattern.indexOf("?")>=0){const initDate=new CronDate(new Date,this.timezone).getDate(true);parts[0]=parts[0].replace("?",initDate.getSeconds());parts[1]=parts[1].replace("?",initDate.getMinutes());parts[2]=parts[2].replace("?",initDate.getHours());if(!this.starDOM)parts[3]=parts[3].replace("?",initDate.getDate());parts[4]=parts[4].replace("?",initDate.getMonth()+1);if(!this.starDOW)parts[5]=parts[5].replace("?",initDate.getDay())}this.throwAtIllegalCharacters(parts);this.partToArray("second",parts[0],0,1);this.partToArray("minute",parts[1],0,1);this.partToArray("hour",parts[2],0,1);this.partToArray("day",parts[3],-1,1);this.partToArray("month",parts[4],-1,1);this.partToArray("dayOfWeek",parts[5],0,ANY_OCCURRENCE);if(this.dayOfWeek[7]){this.dayOfWeek[0]=this.dayOfWeek[7]}};CronPattern.prototype.partToArray=function(type,conf,valueIndexOffset,defaultValue){const arr=this[type];const lastDayOfMonth=type==="day"&&this.lastDayOfMonth;if(conf===""&&!lastDayOfMonth)throw new TypeError("CronPattern: configuration entry "+type+" ("+conf+") is empty, check for trailing spaces.");if(conf==="*")return arr.fill(defaultValue);const split=conf.split(",");if(split.length>1){for(let i=0;i6)&&index!=="L"){throw new RangeError("CronPattern: Invalid value for dayOfWeek: "+index)}this.setNthWeekdayOfMonth(index,value);return}if(part==="second"||part==="minute"){if(index<0||index>=60){throw new RangeError("CronPattern: Invalid value for "+part+": "+index)}}else if(part==="hour"){if(index<0||index>=24){throw new RangeError("CronPattern: Invalid value for "+part+": "+index)}}else if(part==="day"){if(index<0||index>=31){throw new RangeError("CronPattern: Invalid value for "+part+": "+index)}}else if(part==="month"){if(index<0||index>=12){throw new RangeError("CronPattern: Invalid value for "+part+": "+index)}}this[part][index]=value};CronPattern.prototype.handleRangeWithStepping=function(conf,type,valueIndexOffset,defaultValue){const result=this.extractNth(conf,type);const matches=result[0].match(/^(\d+)-(\d+)\/(\d+)$/);if(matches===null)throw new TypeError("CronPattern: Syntax error, illegal range with stepping: '"+conf+"'");let[,lower,upper,steps]=matches;lower=parseInt(lower,10)+valueIndexOffset;upper=parseInt(upper,10)+valueIndexOffset;steps=parseInt(steps,10);if(isNaN(lower))throw new TypeError("CronPattern: Syntax error, illegal lower range (NaN)");if(isNaN(upper))throw new TypeError("CronPattern: Syntax error, illegal upper range (NaN)");if(isNaN(steps))throw new TypeError("CronPattern: Syntax error, illegal stepping: (NaN)");if(steps===0)throw new TypeError("CronPattern: Syntax error, illegal stepping: 0");if(steps>this[type].length)throw new TypeError("CronPattern: Syntax error, steps cannot be greater than maximum value of part ("+this[type].length+")");if(lower>upper)throw new TypeError("CronPattern: From value is larger than to value: '"+conf+"'");for(let i=lower;i<=upper;i+=steps){this.setPart(type,i,result[1]||defaultValue)}};CronPattern.prototype.extractNth=function(conf,type){let rest=conf;let nth;if(rest.includes("#")){if(type!=="dayOfWeek"){throw new Error("CronPattern: nth (#) only allowed in day-of-week field")}nth=rest.split("#")[1];rest=rest.split("#")[0]}return[rest,nth]};CronPattern.prototype.handleRange=function(conf,type,valueIndexOffset,defaultValue){const result=this.extractNth(conf,type);const split=result[0].split("-");if(split.length!==2){throw new TypeError("CronPattern: Syntax error, illegal range: '"+conf+"'")}const lower=parseInt(split[0],10)+valueIndexOffset,upper=parseInt(split[1],10)+valueIndexOffset;if(isNaN(lower)){throw new TypeError("CronPattern: Syntax error, illegal lower range (NaN)")}else if(isNaN(upper)){throw new TypeError("CronPattern: Syntax error, illegal upper range (NaN)")}if(lower>upper){throw new TypeError("CronPattern: From value is larger than to value: '"+conf+"'")}for(let i=lower;i<=upper;i++){this.setPart(type,i,result[1]||defaultValue)}};CronPattern.prototype.handleStepping=function(conf,type,valueIndexOffset,defaultValue){const result=this.extractNth(conf,type);const split=result[0].split("/");if(split.length!==2){throw new TypeError("CronPattern: Syntax error, illegal stepping: '"+conf+"'")}let start=0;if(split[0]!=="*"){start=parseInt(split[0],10)+valueIndexOffset}const steps=parseInt(split[1],10);if(isNaN(steps))throw new TypeError("CronPattern: Syntax error, illegal stepping: (NaN)");if(steps===0)throw new TypeError("CronPattern: Syntax error, illegal stepping: 0");if(steps>this[type].length)throw new TypeError("CronPattern: Syntax error, max steps for part is ("+this[type].length+")");for(let i=start;i0){this["dayOfWeek"][index]=this["dayOfWeek"][index]|OCCURRENCE_BITMASKS[nthWeekday-1]}else if(nthWeekday===ANY_OCCURRENCE){this["dayOfWeek"][index]=ANY_OCCURRENCE}else{throw new TypeError(`CronPattern: nth weekday of of range, should be 1-5 or L. Value: ${nthWeekday}`)}};const DaysOfMonth=[31,28,31,30,31,30,31,31,30,31,30,31];const RecursionSteps=[["month","year",0],["day","month",-1],["hour","day",0],["minute","hour",0],["second","minute",0]];function CronDate(d,tz){this.tz=tz;if(d&&d instanceof Date){if(!isNaN(d)){this.fromDate(d)}else{throw new TypeError("CronDate: Invalid date passed to CronDate constructor")}}else if(d===void 0){this.fromDate(new Date)}else if(d&&typeof d==="string"){this.fromString(d)}else if(d instanceof CronDate){this.fromCronDate(d)}else{throw new TypeError("CronDate: Invalid type ("+typeof d+") passed to CronDate constructor")}}CronDate.prototype.isNthWeekdayOfMonth=function(year,month,day,nth){const date=new Date(Date.UTC(year,month,day));const weekday=date.getUTCDay();let count=0;for(let d=1;d<=day;d++){if(new Date(Date.UTC(year,month,d)).getUTCDay()===weekday){count++}}if(nth&ANY_OCCURRENCE&&OCCURRENCE_BITMASKS[count-1]&nth){return true}if(nth&LAST_OCCURRENCE){const daysInMonth=new Date(Date.UTC(year,month+1,0)).getUTCDate();for(let d=day+1;d<=daysInMonth;d++){if(new Date(Date.UTC(year,month,d)).getUTCDay()===weekday){return false}}return true}return false};CronDate.prototype.fromDate=function(inDate){if(this.tz!==void 0){if(typeof this.tz==="number"){this.ms=inDate.getUTCMilliseconds();this.second=inDate.getUTCSeconds();this.minute=inDate.getUTCMinutes()+this.tz;this.hour=inDate.getUTCHours();this.day=inDate.getUTCDate();this.month=inDate.getUTCMonth();this.year=inDate.getUTCFullYear();this.apply()}else{const d=minitz.toTZ(inDate,this.tz);this.ms=inDate.getMilliseconds();this.second=d.s;this.minute=d.i;this.hour=d.h;this.day=d.d;this.month=d.m-1;this.year=d.y}}else{this.ms=inDate.getMilliseconds();this.second=inDate.getSeconds();this.minute=inDate.getMinutes();this.hour=inDate.getHours();this.day=inDate.getDate();this.month=inDate.getMonth();this.year=inDate.getFullYear()}};CronDate.prototype.fromCronDate=function(d){this.tz=d.tz;this.year=d.year;this.month=d.month;this.day=d.day;this.hour=d.hour;this.minute=d.minute;this.second=d.second;this.ms=d.ms};CronDate.prototype.apply=function(){if(this.month>11||this.day>DaysOfMonth[this.month]||this.hour>59||this.minute>59||this.second>59||this.hour<0||this.minute<0||this.second<0){const d=new Date(Date.UTC(this.year,this.month,this.day,this.hour,this.minute,this.second,this.ms));this.ms=d.getUTCMilliseconds();this.second=d.getUTCSeconds();this.minute=d.getUTCMinutes();this.hour=d.getUTCHours();this.day=d.getUTCDate();this.month=d.getUTCMonth();this.year=d.getUTCFullYear();return true}else{return false}};CronDate.prototype.fromString=function(str){if(typeof this.tz==="number"){const inDate=minitz.fromTZISO(str);this.ms=inDate.getUTCMilliseconds();this.second=inDate.getUTCSeconds();this.minute=inDate.getUTCMinutes();this.hour=inDate.getUTCHours();this.day=inDate.getUTCDate();this.month=inDate.getUTCMonth();this.year=inDate.getUTCFullYear();this.apply()}else{return this.fromDate(minitz.fromTZISO(str,this.tz))}};CronDate.prototype.findNext=function(options,target,pattern,offset){const originalTarget=this[target];let lastDayOfMonth;if(pattern.lastDayOfMonth){if(this.month!==1){lastDayOfMonth=DaysOfMonth[this.month]}else{lastDayOfMonth=new Date(Date.UTC(this.year,this.month+1,0,0,0,0,0)).getUTCDate()}}const fDomWeekDay=!pattern.starDOW&&target=="day"?new Date(Date.UTC(this.year,this.month,1,0,0,0,0)).getUTCDay():undefined;for(let i=this[target]+offset;i1){let resetLevel=doing+1;while(resetLevel=RecursionSteps.length){return this}else if(this.year>=3e3){return null}else{return this.recurse(pattern,options,doing)}};CronDate.prototype.increment=function(pattern,options,hasPreviousRun){this.second+=options.interval>1&&hasPreviousRun?options.interval:1;this.ms=0;this.apply();return this.recurse(pattern,options,0)};CronDate.prototype.getDate=function(internal){if(internal||this.tz===void 0){return new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.ms)}else{if(typeof this.tz==="number"){return new Date(Date.UTC(this.year,this.month,this.day,this.hour,this.minute-this.tz,this.second,this.ms))}else{return minitz(this.year,this.month+1,this.day,this.hour,this.minute,this.second,this.tz)}}};CronDate.prototype.getTime=function(){return this.getDate().getTime()};function isFunction(v){return Object.prototype.toString.call(v)==="[object Function]"||"function"===typeof v||v instanceof Function}function unrefTimer(timer){if(typeof Deno!=="undefined"&&typeof Deno.unrefTimer!=="undefined"){Deno.unrefTimer(timer)}else if(timer&&typeof timer.unref!=="undefined"){timer.unref()}}const maxDelay=30*1e3;const scheduledJobs=[];function Cron(pattern,fnOrOptions1,fnOrOptions2){if(!(this instanceof Cron)){return new Cron(pattern,fnOrOptions1,fnOrOptions2)}let options,func;if(isFunction(fnOrOptions1)){func=fnOrOptions1}else if(typeof fnOrOptions1==="object"){options=fnOrOptions1}else if(fnOrOptions1!==void 0){throw new Error("Cron: Invalid argument passed for optionsIn. Should be one of function, or object (options).")}if(isFunction(fnOrOptions2)){func=fnOrOptions2}else if(typeof fnOrOptions2==="object"){options=fnOrOptions2}else if(fnOrOptions2!==void 0){throw new Error("Cron: Invalid argument passed for funcIn. Should be one of function, or object (options).")}this.name=options?options.name:void 0;this.options=CronOptions(options);this._states={kill:false,blocking:false,previousRun:void 0,currentRun:void 0,once:void 0,currentTimeout:void 0,maxRuns:options?options.maxRuns:void 0,paused:options?options.paused:false,pattern:void 0};if(pattern&&(pattern instanceof Date||typeof pattern==="string"&&pattern.indexOf(":")>0)){this._states.once=new CronDate(pattern,this.options.timezone||this.options.utcOffset)}else{this._states.pattern=new CronPattern(pattern,this.options.timezone)}if(this.name){const existing=scheduledJobs.find(j=>j.name===this.name);if(existing){throw new Error("Cron: Tried to initialize new named job '"+this.name+"', but name already taken.")}else{scheduledJobs.push(this)}}if(func!==void 0){this.fn=func;this.schedule()}return this}Cron.prototype.nextRun=function(prev){const next=this._next(prev);return next?next.getDate():null};Cron.prototype.nextRuns=function(n,previous){if(n>this._states.maxRuns){n=this._states.maxRuns}const enumeration=[];let prev=previous||this._states.currentRun;while(n--&&(prev=this.nextRun(prev))){enumeration.push(prev)}return enumeration};Cron.prototype.getPattern=function(){return this._states.pattern?this._states.pattern.pattern:void 0};Cron.prototype.isRunning=function(){const nextRunTime=this.nextRun(this._states.currentRun);const isRunning=!this._states.paused;const isScheduled=this.fn!==void 0;const notIsKilled=!this._states.kill;return isRunning&&isScheduled&¬IsKilled&&nextRunTime!==null};Cron.prototype.isStopped=function(){return this._states.kill};Cron.prototype.isBusy=function(){return this._states.blocking};Cron.prototype.currentRun=function(){return this._states.currentRun?this._states.currentRun.getDate():null};Cron.prototype.previousRun=function(){return this._states.previousRun?this._states.previousRun.getDate():null};Cron.prototype.msToNext=function(prev){prev=prev||new Date;const next=this._next(prev);if(next){return next.getTime()-prev.getTime()}else{return null}};Cron.prototype.stop=function(){this._states.kill=true;if(this._states.currentTimeout){clearTimeout(this._states.currentTimeout)}const jobIndex=scheduledJobs.indexOf(this);if(jobIndex>=0){scheduledJobs.splice(jobIndex,1)}};Cron.prototype.pause=function(){this._states.paused=true;return!this._states.kill};Cron.prototype.resume=function(){this._states.paused=false;return!this._states.kill};Cron.prototype.schedule=function(func){if(func&&this.fn){throw new Error("Cron: It is not allowed to schedule two functions using the same Croner instance.")}else if(func){this.fn=func}let waitMs=this.msToNext();const target=this.nextRun(this._states.currentRun);if(waitMs===null||waitMs===undefined||isNaN(waitMs)||target===null)return this;if(waitMs>maxDelay){waitMs=maxDelay}this._states.currentTimeout=setTimeout(()=>this._checkTrigger(target),waitMs);if(this._states.currentTimeout&&this.options.unref){unrefTimer(this._states.currentTimeout)}return this};Cron.prototype._trigger=async function(initiationDate){this._states.blocking=true;this._states.currentRun=new CronDate(void 0,this.options.timezone||this.options.utcOffset);if(this.options.catch){try{await this.fn(this,this.options.context)}catch(_e){if(isFunction(this.options.catch)){this.options.catch(_e,this)}}}else{await this.fn(this,this.options.context)}this._states.previousRun=new CronDate(initiationDate,this.options.timezone||this.options.utcOffset);this._states.blocking=false};Cron.prototype.trigger=async function(){await this._trigger()};Cron.prototype._checkTrigger=function(target){const now=new Date,shouldRun=!this._states.paused&&now.getTime()>=target,isBlocked=this._states.blocking&&this.options.protect;if(shouldRun&&!isBlocked){this._states.maxRuns--;this._trigger()}else{if(shouldRun&&isBlocked&&isFunction(this.options.protect)){setTimeout(()=>this.options.protect(this),0)}}this.schedule()};Cron.prototype._next=function(prev){const hasPreviousRun=prev||this._states.currentRun?true:false;prev=new CronDate(prev,this.options.timezone||this.options.utcOffset);if(this.options.startAt&&prev&&prev.getTime()=this.options.stopAt.getTime()){return null}else{return nextRun}};Cron.Cron=Cron;Cron.scheduledJobs=scheduledJobs;module.exports=Cron; \ No newline at end of file +"use strict";function minitz(y,m,d,h,i,s,tz,throwOnInvalid){return minitz.fromTZ(minitz.tp(y,m,d,h,i,s,tz),throwOnInvalid)}minitz.fromTZISO=(localTimeStr,tz,throwOnInvalid)=>{return minitz.fromTZ(parseISOLocal(localTimeStr,tz),throwOnInvalid)};minitz.fromTZ=function(tp,throwOnInvalid){const inDate=new Date(Date.UTC(tp.y,tp.m-1,tp.d,tp.h,tp.i,tp.s)),offset=getTimezoneOffset(tp.tz,inDate),dateGuess=new Date(inDate.getTime()-offset),dateOffsGuess=getTimezoneOffset(tp.tz,dateGuess);if(dateOffsGuess-offset===0){return dateGuess}else{const dateGuess2=new Date(inDate.getTime()-dateOffsGuess),dateOffsGuess2=getTimezoneOffset(tp.tz,dateGuess2);if(dateOffsGuess2-dateOffsGuess===0){return dateGuess2}else if(!throwOnInvalid&&dateOffsGuess2-dateOffsGuess>0){return dateGuess2}else if(!throwOnInvalid){return dateGuess}else{throw new Error("Invalid date passed to fromTZ()")}}};minitz.toTZ=function(d,tzStr){const localDateString=d.toLocaleString("en-US",{timeZone:tzStr}).replace(/[\u202f]/," ");const td=new Date(localDateString);return{y:td.getFullYear(),m:td.getMonth()+1,d:td.getDate(),h:td.getHours(),i:td.getMinutes(),s:td.getSeconds(),tz:tzStr}};minitz.tp=(y,m,d,h,i,s,tz)=>{return{y:y,m:m,d:d,h:h,i:i,s:s,tz:tz}};function getTimezoneOffset(timeZone,date=new Date){const tz=date.toLocaleString("en-US",{timeZone:timeZone,timeZoneName:"shortOffset"}).split(" ").slice(-1)[0];const dateString=date.toLocaleString("en-US").replace(/[\u202f]/," ");return Date.parse(`${dateString} GMT`)-Date.parse(`${dateString} ${tz}`)}function parseISOLocal(dtStr,tz){const pd=new Date(Date.parse(dtStr));if(isNaN(pd)){throw new Error("minitz: Invalid ISO8601 passed to parser.")}const stringEnd=dtStr.substring(9);if(dtStr.includes("Z")||stringEnd.includes("-")||stringEnd.includes("+")){return minitz.tp(pd.getUTCFullYear(),pd.getUTCMonth()+1,pd.getUTCDate(),pd.getUTCHours(),pd.getUTCMinutes(),pd.getUTCSeconds(),"Etc/UTC")}else{return minitz.tp(pd.getFullYear(),pd.getMonth()+1,pd.getDate(),pd.getHours(),pd.getMinutes(),pd.getSeconds(),tz)}}minitz.minitz=minitz;function CronOptions(options){if(options===void 0){options={}}delete options.name;options.legacyMode=options.legacyMode===void 0?true:options.legacyMode;options.paused=options.paused===void 0?false:options.paused;options.maxRuns=options.maxRuns===void 0?Infinity:options.maxRuns;options.catch=options.catch===void 0?false:options.catch;options.interval=options.interval===void 0?0:parseInt(options.interval,10);options.utcOffset=options.utcOffset===void 0?void 0:parseInt(options.utcOffset,10);options.unref=options.unref===void 0?false:options.unref;if(options.startAt){options.startAt=new CronDate(options.startAt,options.timezone)}if(options.stopAt){options.stopAt=new CronDate(options.stopAt,options.timezone)}if(options.interval!==null){if(isNaN(options.interval)){throw new Error("CronOptions: Supplied value for interval is not a number")}else if(options.interval<0){throw new Error("CronOptions: Supplied value for interval can not be negative")}}if(options.utcOffset!==void 0){if(isNaN(options.utcOffset)){throw new Error("CronOptions: Invalid value passed for utcOffset, should be number representing minutes offset from UTC.")}else if(options.utcOffset<-870||options.utcOffset>870){throw new Error("CronOptions: utcOffset out of bounds.")}if(options.utcOffset!==void 0&&options.timezone){throw new Error("CronOptions: Combining 'utcOffset' with 'timezone' is not allowed.")}}if(options.unref!==true&&options.unref!==false){throw new Error("CronOptions: Unref should be either true, false or undefined(false).")}return options}const LAST_OCCURRENCE=32;const ANY_OCCURRENCE=1|2|4|8|16|LAST_OCCURRENCE;const OCCURRENCE_BITMASKS=[1,2,4,16,16];function CronPattern(pattern,timezone){this.pattern=pattern;this.timezone=timezone;this.second=Array(60).fill(0);this.minute=Array(60).fill(0);this.hour=Array(24).fill(0);this.day=Array(31).fill(0);this.month=Array(12).fill(0);this.dayOfWeek=Array(7).fill(0);this.lastDayOfMonth=false;this.starDOM=false;this.starDOW=false;this.parse()}CronPattern.prototype.parse=function(){if(!(typeof this.pattern==="string"||this.pattern.constructor===String)){throw new TypeError("CronPattern: Pattern has to be of type string.")}if(this.pattern.indexOf("@")>=0)this.pattern=this.handleNicknames(this.pattern).trim();const parts=this.pattern.replace(/\s+/g," ").split(" ");if(parts.length<5||parts.length>6){throw new TypeError("CronPattern: invalid configuration format ('"+this.pattern+"'), exactly five or six space separated parts are required.")}if(parts.length===5){parts.unshift("0")}if(parts[3].indexOf("L")>=0){parts[3]=parts[3].replace("L","");this.lastDayOfMonth=true}if(parts[3]=="*"){this.starDOM=true}if(parts[4].length>=3)parts[4]=this.replaceAlphaMonths(parts[4]);if(parts[5].length>=3)parts[5]=this.replaceAlphaDays(parts[5]);if(parts[5]=="*"){this.starDOW=true}if(this.pattern.indexOf("?")>=0){const initDate=new CronDate(new Date,this.timezone).getDate(true);parts[0]=parts[0].replace("?",initDate.getSeconds());parts[1]=parts[1].replace("?",initDate.getMinutes());parts[2]=parts[2].replace("?",initDate.getHours());if(!this.starDOM)parts[3]=parts[3].replace("?",initDate.getDate());parts[4]=parts[4].replace("?",initDate.getMonth()+1);if(!this.starDOW)parts[5]=parts[5].replace("?",initDate.getDay())}this.throwAtIllegalCharacters(parts);this.partToArray("second",parts[0],0,1);this.partToArray("minute",parts[1],0,1);this.partToArray("hour",parts[2],0,1);this.partToArray("day",parts[3],-1,1);this.partToArray("month",parts[4],-1,1);this.partToArray("dayOfWeek",parts[5],0,ANY_OCCURRENCE);if(this.dayOfWeek[7]){this.dayOfWeek[0]=this.dayOfWeek[7]}};CronPattern.prototype.partToArray=function(type,conf,valueIndexOffset,defaultValue){const arr=this[type];const lastDayOfMonth=type==="day"&&this.lastDayOfMonth;if(conf===""&&!lastDayOfMonth)throw new TypeError("CronPattern: configuration entry "+type+" ("+conf+") is empty, check for trailing spaces.");if(conf==="*")return arr.fill(defaultValue);const split=conf.split(",");if(split.length>1){for(let i=0;i6)&&index!=="L"){throw new RangeError("CronPattern: Invalid value for dayOfWeek: "+index)}this.setNthWeekdayOfMonth(index,value);return}if(part==="second"||part==="minute"){if(index<0||index>=60){throw new RangeError("CronPattern: Invalid value for "+part+": "+index)}}else if(part==="hour"){if(index<0||index>=24){throw new RangeError("CronPattern: Invalid value for "+part+": "+index)}}else if(part==="day"){if(index<0||index>=31){throw new RangeError("CronPattern: Invalid value for "+part+": "+index)}}else if(part==="month"){if(index<0||index>=12){throw new RangeError("CronPattern: Invalid value for "+part+": "+index)}}this[part][index]=value};CronPattern.prototype.handleRangeWithStepping=function(conf,type,valueIndexOffset,defaultValue){const result=this.extractNth(conf,type);const matches=result[0].match(/^(\d+)-(\d+)\/(\d+)$/);if(matches===null)throw new TypeError("CronPattern: Syntax error, illegal range with stepping: '"+conf+"'");let[,lower,upper,steps]=matches;lower=parseInt(lower,10)+valueIndexOffset;upper=parseInt(upper,10)+valueIndexOffset;steps=parseInt(steps,10);if(isNaN(lower))throw new TypeError("CronPattern: Syntax error, illegal lower range (NaN)");if(isNaN(upper))throw new TypeError("CronPattern: Syntax error, illegal upper range (NaN)");if(isNaN(steps))throw new TypeError("CronPattern: Syntax error, illegal stepping: (NaN)");if(steps===0)throw new TypeError("CronPattern: Syntax error, illegal stepping: 0");if(steps>this[type].length)throw new TypeError("CronPattern: Syntax error, steps cannot be greater than maximum value of part ("+this[type].length+")");if(lower>upper)throw new TypeError("CronPattern: From value is larger than to value: '"+conf+"'");for(let i=lower;i<=upper;i+=steps){this.setPart(type,i,result[1]||defaultValue)}};CronPattern.prototype.extractNth=function(conf,type){let rest=conf;let nth;if(rest.includes("#")){if(type!=="dayOfWeek"){throw new Error("CronPattern: nth (#) only allowed in day-of-week field")}nth=rest.split("#")[1];rest=rest.split("#")[0]}return[rest,nth]};CronPattern.prototype.handleRange=function(conf,type,valueIndexOffset,defaultValue){const result=this.extractNth(conf,type);const split=result[0].split("-");if(split.length!==2){throw new TypeError("CronPattern: Syntax error, illegal range: '"+conf+"'")}const lower=parseInt(split[0],10)+valueIndexOffset,upper=parseInt(split[1],10)+valueIndexOffset;if(isNaN(lower)){throw new TypeError("CronPattern: Syntax error, illegal lower range (NaN)")}else if(isNaN(upper)){throw new TypeError("CronPattern: Syntax error, illegal upper range (NaN)")}if(lower>upper){throw new TypeError("CronPattern: From value is larger than to value: '"+conf+"'")}for(let i=lower;i<=upper;i++){this.setPart(type,i,result[1]||defaultValue)}};CronPattern.prototype.handleStepping=function(conf,type,valueIndexOffset,defaultValue){const result=this.extractNth(conf,type);const split=result[0].split("/");if(split.length!==2){throw new TypeError("CronPattern: Syntax error, illegal stepping: '"+conf+"'")}let start=0;if(split[0]!=="*"){start=parseInt(split[0],10)+valueIndexOffset}const steps=parseInt(split[1],10);if(isNaN(steps))throw new TypeError("CronPattern: Syntax error, illegal stepping: (NaN)");if(steps===0)throw new TypeError("CronPattern: Syntax error, illegal stepping: 0");if(steps>this[type].length)throw new TypeError("CronPattern: Syntax error, max steps for part is ("+this[type].length+")");for(let i=start;i0){this["dayOfWeek"][index]=this["dayOfWeek"][index]|OCCURRENCE_BITMASKS[nthWeekday-1]}else if(nthWeekday===ANY_OCCURRENCE){this["dayOfWeek"][index]=ANY_OCCURRENCE}else{throw new TypeError(`CronPattern: nth weekday of of range, should be 1-5 or L. Value: ${nthWeekday}`)}};const DaysOfMonth=[31,28,31,30,31,30,31,31,30,31,30,31];const RecursionSteps=[["month","year",0],["day","month",-1],["hour","day",0],["minute","hour",0],["second","minute",0]];function CronDate(d,tz){this.tz=tz;if(d&&d instanceof Date){if(!isNaN(d)){this.fromDate(d)}else{throw new TypeError("CronDate: Invalid date passed to CronDate constructor")}}else if(d===void 0){this.fromDate(new Date)}else if(d&&typeof d==="string"){this.fromString(d)}else if(d instanceof CronDate){this.fromCronDate(d)}else{throw new TypeError("CronDate: Invalid type ("+typeof d+") passed to CronDate constructor")}}CronDate.prototype.isNthWeekdayOfMonth=function(year,month,day,nth){const date=new Date(Date.UTC(year,month,day));const weekday=date.getUTCDay();let count=0;for(let d=1;d<=day;d++){if(new Date(Date.UTC(year,month,d)).getUTCDay()===weekday){count++}}if(nth&ANY_OCCURRENCE&&OCCURRENCE_BITMASKS[count-1]&nth){return true}if(nth&LAST_OCCURRENCE){const daysInMonth=new Date(Date.UTC(year,month+1,0)).getUTCDate();for(let d=day+1;d<=daysInMonth;d++){if(new Date(Date.UTC(year,month,d)).getUTCDay()===weekday){return false}}return true}return false};CronDate.prototype.fromDate=function(inDate){if(this.tz!==void 0){if(typeof this.tz==="number"){this.ms=inDate.getUTCMilliseconds();this.second=inDate.getUTCSeconds();this.minute=inDate.getUTCMinutes()+this.tz;this.hour=inDate.getUTCHours();this.day=inDate.getUTCDate();this.month=inDate.getUTCMonth();this.year=inDate.getUTCFullYear();this.apply()}else{const d=minitz.toTZ(inDate,this.tz);this.ms=inDate.getMilliseconds();this.second=d.s;this.minute=d.i;this.hour=d.h;this.day=d.d;this.month=d.m-1;this.year=d.y}}else{this.ms=inDate.getMilliseconds();this.second=inDate.getSeconds();this.minute=inDate.getMinutes();this.hour=inDate.getHours();this.day=inDate.getDate();this.month=inDate.getMonth();this.year=inDate.getFullYear()}};CronDate.prototype.fromCronDate=function(d){this.tz=d.tz;this.year=d.year;this.month=d.month;this.day=d.day;this.hour=d.hour;this.minute=d.minute;this.second=d.second;this.ms=d.ms};CronDate.prototype.apply=function(){if(this.month>11||this.day>DaysOfMonth[this.month]||this.hour>59||this.minute>59||this.second>59||this.hour<0||this.minute<0||this.second<0){const d=new Date(Date.UTC(this.year,this.month,this.day,this.hour,this.minute,this.second,this.ms));this.ms=d.getUTCMilliseconds();this.second=d.getUTCSeconds();this.minute=d.getUTCMinutes();this.hour=d.getUTCHours();this.day=d.getUTCDate();this.month=d.getUTCMonth();this.year=d.getUTCFullYear();return true}else{return false}};CronDate.prototype.fromString=function(str){if(typeof this.tz==="number"){const inDate=minitz.fromTZISO(str);this.ms=inDate.getUTCMilliseconds();this.second=inDate.getUTCSeconds();this.minute=inDate.getUTCMinutes();this.hour=inDate.getUTCHours();this.day=inDate.getUTCDate();this.month=inDate.getUTCMonth();this.year=inDate.getUTCFullYear();this.apply()}else{return this.fromDate(minitz.fromTZISO(str,this.tz))}};CronDate.prototype.findNext=function(options,target,pattern,offset){const originalTarget=this[target];let lastDayOfMonth;if(pattern.lastDayOfMonth){if(this.month!==1){lastDayOfMonth=DaysOfMonth[this.month]}else{lastDayOfMonth=new Date(Date.UTC(this.year,this.month+1,0,0,0,0,0)).getUTCDate()}}const fDomWeekDay=!pattern.starDOW&&target=="day"?new Date(Date.UTC(this.year,this.month,1,0,0,0,0)).getUTCDay():undefined;for(let i=this[target]+offset;i1){let resetLevel=doing+1;while(resetLevel=RecursionSteps.length){return this}else if(this.year>=3e3){return null}else{return this.recurse(pattern,options,doing)}};CronDate.prototype.increment=function(pattern,options,hasPreviousRun){this.second+=options.interval>1&&hasPreviousRun?options.interval:1;this.ms=0;this.apply();return this.recurse(pattern,options,0)};CronDate.prototype.getDate=function(internal){if(internal||this.tz===void 0){return new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.ms)}else{if(typeof this.tz==="number"){return new Date(Date.UTC(this.year,this.month,this.day,this.hour,this.minute-this.tz,this.second,this.ms))}else{return minitz(this.year,this.month+1,this.day,this.hour,this.minute,this.second,this.tz)}}};CronDate.prototype.getTime=function(){return this.getDate().getTime()};function isFunction(v){return Object.prototype.toString.call(v)==="[object Function]"||"function"===typeof v||v instanceof Function}function unrefTimer(timer){if(typeof Deno!=="undefined"&&typeof Deno.unrefTimer!=="undefined"){Deno.unrefTimer(timer)}else if(timer&&typeof timer.unref!=="undefined"){timer.unref()}}const maxDelay=30*1e3;const scheduledJobs=[];function Cron(pattern,fnOrOptions1,fnOrOptions2){if(!(this instanceof Cron)){return new Cron(pattern,fnOrOptions1,fnOrOptions2)}let options,func;if(isFunction(fnOrOptions1)){func=fnOrOptions1}else if(typeof fnOrOptions1==="object"){options=fnOrOptions1}else if(fnOrOptions1!==void 0){throw new Error("Cron: Invalid argument passed for optionsIn. Should be one of function, or object (options).")}if(isFunction(fnOrOptions2)){func=fnOrOptions2}else if(typeof fnOrOptions2==="object"){options=fnOrOptions2}else if(fnOrOptions2!==void 0){throw new Error("Cron: Invalid argument passed for funcIn. Should be one of function, or object (options).")}this.name=options?options.name:void 0;this.options=CronOptions(options);this._states={kill:false,blocking:false,previousRun:void 0,currentRun:void 0,once:void 0,currentTimeout:void 0,maxRuns:options?options.maxRuns:void 0,paused:options?options.paused:false,pattern:void 0};if(pattern&&(pattern instanceof Date||typeof pattern==="string"&&pattern.indexOf(":")>0)){this._states.once=new CronDate(pattern,this.options.timezone||this.options.utcOffset)}else{this._states.pattern=new CronPattern(pattern,this.options.timezone)}if(this.name){const existing=scheduledJobs.find(j=>j.name===this.name);if(existing){throw new Error("Cron: Tried to initialize new named job '"+this.name+"', but name already taken.")}else{scheduledJobs.push(this)}}if(func!==void 0){this.fn=func;this.schedule()}return this}Cron.prototype.nextRun=function(prev){const next=this._next(prev);return next?next.getDate():null};Cron.prototype.nextRuns=function(n,previous){if(n>this._states.maxRuns){n=this._states.maxRuns}const enumeration=[];let prev=previous||this._states.currentRun;while(n--&&(prev=this.nextRun(prev))){enumeration.push(prev)}return enumeration};Cron.prototype.getPattern=function(){return this._states.pattern?this._states.pattern.pattern:void 0};Cron.prototype.isRunning=function(){const nextRunTime=this.nextRun(this._states.currentRun);const isRunning=!this._states.paused;const isScheduled=this.fn!==void 0;const notIsKilled=!this._states.kill;return isRunning&&isScheduled&¬IsKilled&&nextRunTime!==null};Cron.prototype.isStopped=function(){return this._states.kill};Cron.prototype.isBusy=function(){return this._states.blocking};Cron.prototype.currentRun=function(){return this._states.currentRun?this._states.currentRun.getDate():null};Cron.prototype.previousRun=function(){return this._states.previousRun?this._states.previousRun.getDate():null};Cron.prototype.msToNext=function(prev){prev=prev||new Date;const next=this._next(prev);if(next){return next.getTime()-prev.getTime()}else{return null}};Cron.prototype.stop=function(){this._states.kill=true;if(this._states.currentTimeout){clearTimeout(this._states.currentTimeout)}const jobIndex=scheduledJobs.indexOf(this);if(jobIndex>=0){scheduledJobs.splice(jobIndex,1)}};Cron.prototype.pause=function(){this._states.paused=true;return!this._states.kill};Cron.prototype.resume=function(){this._states.paused=false;return!this._states.kill};Cron.prototype.schedule=function(func){if(func&&this.fn){throw new Error("Cron: It is not allowed to schedule two functions using the same Croner instance.")}else if(func){this.fn=func}let waitMs=this.msToNext();const target=this.nextRun(this._states.currentRun);if(waitMs===null||waitMs===undefined||isNaN(waitMs)||target===null)return this;if(waitMs>maxDelay){waitMs=maxDelay}this._states.currentTimeout=setTimeout(()=>this._checkTrigger(target),waitMs);if(this._states.currentTimeout&&this.options.unref){unrefTimer(this._states.currentTimeout)}return this};Cron.prototype._trigger=async function(initiationDate){this._states.blocking=true;this._states.currentRun=new CronDate(void 0,this.options.timezone||this.options.utcOffset);if(this.options.catch){try{await this.fn(this,this.options.context)}catch(_e){if(isFunction(this.options.catch)){this.options.catch(_e,this)}}}else{await this.fn(this,this.options.context)}this._states.previousRun=new CronDate(initiationDate,this.options.timezone||this.options.utcOffset);this._states.blocking=false};Cron.prototype.trigger=async function(){await this._trigger()};Cron.prototype._checkTrigger=function(target){const now=new Date,shouldRun=!this._states.paused&&now.getTime()>=target,isBlocked=this._states.blocking&&this.options.protect;if(shouldRun&&!isBlocked){this._states.maxRuns--;this._trigger()}else{if(shouldRun&&isBlocked&&isFunction(this.options.protect)){setTimeout(()=>this.options.protect(this),0)}}this.schedule()};Cron.prototype._next=function(prev){let hasPreviousRun=prev||this._states.currentRun?true:false;if(!prev&&this.options.startAt&&this.options.interval){prev=this.options.startAt;const now=new CronDate(undefined,this.options.timezone||this.options.utcOffset);let prevTimePlusInterval=prev.getTime()+this.options.interval*1e3;while(prevTimePlusInterval<=now.getTime()){prev=new CronDate(prev,this.options.timezone||this.options.utcOffset).increment(this._states.pattern,this.options,true);prevTimePlusInterval=prev.getTime()+this.options.interval*1e3}hasPreviousRun=true}prev=new CronDate(prev,this.options.timezone||this.options.utcOffset);if(this.options.startAt&&prev&&prev.getTime()=this.options.stopAt.getTime()){return null}else{return nextRun}};Cron.Cron=Cron;Cron.scheduledJobs=scheduledJobs;module.exports=Cron; \ No newline at end of file diff --git a/dist/croner.min.cjs.map b/dist/croner.min.cjs.map index 409cc77..29e429d 100644 --- a/dist/croner.min.cjs.map +++ b/dist/croner.min.cjs.map @@ -1 +1 @@ -{"version":3,"sources":["dist/croner.cjs"],"names":["minitz","y","m","d","h","i","s","tz","throwOnInvalid","fromTZ","tp","fromTZISO","localTimeStr","parseISOLocal","inDate","Date","UTC","offset","getTimezoneOffset","dateGuess","getTime","dateOffsGuess","dateGuess2","dateOffsGuess2","Error","toTZ","tzStr","localDateString","toLocaleString","timeZone","replace","td","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","date","timeZoneName","split","slice","dateString","parse","dtStr","pd","isNaN","stringEnd","substring","includes","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","CronOptions","options","name","legacyMode","paused","maxRuns","Infinity","catch","interval","parseInt","utcOffset","unref","startAt","CronDate","timezone","stopAt","LAST_OCCURRENCE","ANY_OCCURRENCE","OCCURRENCE_BITMASKS","CronPattern","pattern","this","second","Array","fill","minute","hour","day","month","dayOfWeek","lastDayOfMonth","starDOM","starDOW","prototype","constructor","String","TypeError","indexOf","handleNicknames","trim","parts","length","unshift","replaceAlphaMonths","replaceAlphaDays","initDate","getDay","throwAtIllegalCharacters","partToArray","type","conf","valueIndexOffset","defaultValue","arr","let","handleRangeWithStepping","handleRange","handleStepping","handleNumber","reValidCron","test","result","extractNth","setPart","part","index","value","Object","hasOwnProperty","call","RangeError","setNthWeekdayOfMonth","matches","match","lower","upper","steps","rest","nth","start","cleanPattern","toLowerCase","nthWeekday","DaysOfMonth","RecursionSteps","fromDate","fromString","fromCronDate","isNthWeekdayOfMonth","year","weekday","getUTCDay","count","daysInMonth","ms","getUTCMilliseconds","apply","getMilliseconds","str","findNext","target","originalTarget","fDomWeekDay","undefined","dowMatch","recurse","doing","res","resetLevel","increment","hasPreviousRun","internal","isFunction","v","toString","Function","unrefTimer","timer","Deno","maxDelay","scheduledJobs","Cron","fnOrOptions1","fnOrOptions2","func","_states","kill","blocking","previousRun","currentRun","once","currentTimeout","existing","find","j","push","fn","schedule","nextRun","prev","next","_next","nextRuns","n","previous","enumeration","getPattern","isRunning","nextRunTime","isScheduled","notIsKilled","isStopped","isBusy","msToNext","stop","clearTimeout","jobIndex","splice","pause","resume","waitMs","setTimeout","_checkTrigger","_trigger","async","initiationDate","await","context","_e","trigger","now","shouldRun","isBlocked","protect","module","exports"],"mappings":"AAAA,aA+DC,SAASA,OAAOC,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,GAAIC,gBACtC,OAAOR,OAAOS,OAAOT,OAAOU,GAAGT,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,EAAE,EAAGC,cAAc,CACrE,CAgBAR,OAAOW,UAAY,CAACC,aAAcL,GAAIC,kBACrC,OAAOR,OAAOS,OAAOI,cAAcD,aAAcL,EAAE,EAAGC,cAAc,CACrE,EAcAR,OA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,KAAKxF,UAAU4G,MAAQ,SAAUF,MAChC,MAAM7B,eAAkB6B,MAAQtH,KAAKwG,QAAQI,WAAc,KAAO,MAGlEU,KAAO,IAAI9H,SAAS8H,KAAMtH,KAAKpB,QAAQa,UAAYO,KAAKpB,QAAQS,SAAS,EAGzE,GAAIW,KAAKpB,QAAQW,SAAW+H,MAAQA,KAAK/K,QAAQ,EAAIyD,KAAKpB,QAAQW,QAAQhD,QAAQ,EAAG,CACpF+K,KAAOtH,KAAKpB,QAAQW,OACrB,CAGA,MAAM8H,QAAUrH,KAAKwG,QAAQK,MAC5B,IAAIrH,SAAS8H,KAAMtH,KAAKpB,QAAQa,UAAYO,KAAKpB,QAAQS,SAAS,EAAEmG,UACnExF,KAAKwG,QAAQzG,QACbC,KAAKpB,QACL6G,cACD,EAED,GAAIzF,KAAKwG,QAAQK,MAAQ7G,KAAKwG,QAAQK,KAAKtK,QAAQ,GAAK+K,KAAK/K,QAAQ,EAAG,CACvE,OAAO,IACR,MAAO,GACL8K,UAAY,MACZrH,KAAKwG,QAAQxH,SAAW,GACxBgB,KAAKwG,QAAY,MACjBxG,KAAKpB,QAAQc,QAAU2H,QAAQ9K,QAAQ,GAAKyD,KAAKpB,QAAQc,OAAOnD,QAAQ,EACxE,CACD,OAAO,IACR,KAAO,CAEN,OAAO8K,OACR,CACD,EAEAjB,KAAKA,KAAOA,KACZA,KAAKD,cAAgBA,cAErBsD,OAAOC,QAAUtD"} \ No newline at end of file +{"version":3,"sources":["dist/croner.cjs"],"names":["minitz","y","m","d","h","i","s","tz","throwOnInvalid","fromTZ","tp","fromTZISO","localTimeStr","parseISOLocal","inDate","Date","UTC","offset","getTimezoneOffset","dateGuess","getTime","dateOffsGuess","dateGuess2","dateOffsGuess2","Error","toTZ","tzStr","localDateString","toLocaleString","timeZone","replace","td","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","date","timeZoneName","split","slice","dateString","parse","dtStr","pd","isNaN","stringEnd","substring","includes","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","CronOptions","options","name","legacyMode","paused","maxRuns","Infinity","catch","interval","parseInt","utcOffset","unref","startAt","CronDate","timezone","stopAt","LAST_OCCURRENCE","ANY_OCCURRENCE","OCCURRENCE_BITMASKS","CronPattern","pattern","this","second","Array","fill","minute","hour","day","month","dayOfWeek","lastDayOfMonth","starDOM","starDOW","prototype","constructor","String","TypeError","indexOf","handleNicknames","trim","parts","length","unshift","replaceAlphaMonths","replaceAlphaDays","initDate","getDay","throwAtIllegalCharacters","partToArray","type","conf","valueIndexOffset","defaultValue","arr","let","handleRangeWithStepping","handleRange","handleStepping","handleNumber","reValidCron","test","result","extractNth","setPart","part","index","value","Object","hasOwnProperty","call","RangeError","setNthWeekdayOfMonth","matches","match","lower","upper","steps","rest","nth","start","cleanPattern","toLowerCase","nthWeekday","DaysOfMonth","RecursionSteps","fromDate","fromString","fromCronDate","isNthWeekdayOfMonth","year","weekday","getUTCDay","count","daysInMonth","ms","getUTCMilliseconds","apply","getMilliseconds","str","findNext","target","originalTarget","fDomWeekDay","undefined","dowMatch","recurse","doing","res","resetLevel","increment","hasPreviousRun","internal","isFunction","v","toString","Function","unrefTimer","timer","Deno","maxDelay","scheduledJobs","Cron","fnOrOptions1","fnOrOptions2","func","_states","kill","blocking","previousRun","currentRun","once","currentTimeout","existing","find","j","push","fn","schedule","nextRun","prev","next","_next","nextRuns","n","previous","enumeration","getPattern","isRunning","nextRunTime","isScheduled","notIsKilled","isStopped","isBusy","msToNext","stop","clearTimeout","jobIndex","splice","pause","resume","waitMs","setTimeout","_checkTrigger","_trigger","async","initiationDate","await","context","_e","trigger","now","shouldRun","isBlocked","protect","prevTimePlusInterval","module","exports"],"mappings":"AAAA,aA+DC,SAASA,OAAOC,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,GAAIC,gBACtC,OAAOR,OAAOS,OAAOT,OAAOU,GAAGT,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,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QK,MAAQ7G,KAAKwG,QAAQK,KAAKtK,QAAQ,GAAK+K,KAAK/K,QAAQ,EAAG,CACvE,OAAO,IACR,MAAO,GACL8K,UAAY,MACZrH,KAAKwG,QAAQxH,SAAW,GACxBgB,KAAKwG,QAAY,MACjBxG,KAAKpB,QAAQc,QAAU2H,QAAQ9K,QAAQ,GAAKyD,KAAKpB,QAAQc,OAAOnD,QAAQ,EACxE,CACD,OAAO,IACR,KAAO,CAEN,OAAO8K,OACR,CACD,EAEAjB,KAAKA,KAAOA,KACZA,KAAKD,cAAgBA,cAErBuD,OAAOC,QAAUvD"} \ No newline at end of file diff --git a/dist/croner.min.js b/dist/croner.min.js index 5d975bb..e230cc8 100644 --- a/dist/croner.min.js +++ b/dist/croner.min.js @@ -1 +1 @@ -function minitz(y,m,d,h,i,s,tz,throwOnInvalid){return minitz.fromTZ(minitz.tp(y,m,d,h,i,s,tz),throwOnInvalid)}minitz.fromTZISO=(localTimeStr,tz,throwOnInvalid)=>{return minitz.fromTZ(parseISOLocal(localTimeStr,tz),throwOnInvalid)};minitz.fromTZ=function(tp,throwOnInvalid){const inDate=new Date(Date.UTC(tp.y,tp.m-1,tp.d,tp.h,tp.i,tp.s)),offset=getTimezoneOffset(tp.tz,inDate),dateGuess=new Date(inDate.getTime()-offset),dateOffsGuess=getTimezoneOffset(tp.tz,dateGuess);if(dateOffsGuess-offset===0){return dateGuess}else{const dateGuess2=new Date(inDate.getTime()-dateOffsGuess),dateOffsGuess2=getTimezoneOffset(tp.tz,dateGuess2);if(dateOffsGuess2-dateOffsGuess===0){return dateGuess2}else if(!throwOnInvalid&&dateOffsGuess2-dateOffsGuess>0){return dateGuess2}else if(!throwOnInvalid){return dateGuess}else{throw new Error("Invalid date passed to fromTZ()")}}};minitz.toTZ=function(d,tzStr){const localDateString=d.toLocaleString("en-US",{timeZone:tzStr}).replace(/[\u202f]/," ");const td=new Date(localDateString);return{y:td.getFullYear(),m:td.getMonth()+1,d:td.getDate(),h:td.getHours(),i:td.getMinutes(),s:td.getSeconds(),tz:tzStr}};minitz.tp=(y,m,d,h,i,s,tz)=>{return{y:y,m:m,d:d,h:h,i:i,s:s,tz:tz}};function getTimezoneOffset(timeZone,date=new Date){const tz=date.toLocaleString("en-US",{timeZone:timeZone,timeZoneName:"shortOffset"}).split(" ").slice(-1)[0];const dateString=date.toLocaleString("en-US").replace(/[\u202f]/," ");return Date.parse(`${dateString} GMT`)-Date.parse(`${dateString} ${tz}`)}function parseISOLocal(dtStr,tz){const pd=new Date(Date.parse(dtStr));if(isNaN(pd)){throw new Error("minitz: Invalid ISO8601 passed to parser.")}const stringEnd=dtStr.substring(9);if(dtStr.includes("Z")||stringEnd.includes("-")||stringEnd.includes("+")){return minitz.tp(pd.getUTCFullYear(),pd.getUTCMonth()+1,pd.getUTCDate(),pd.getUTCHours(),pd.getUTCMinutes(),pd.getUTCSeconds(),"Etc/UTC")}else{return minitz.tp(pd.getFullYear(),pd.getMonth()+1,pd.getDate(),pd.getHours(),pd.getMinutes(),pd.getSeconds(),tz)}}minitz.minitz=minitz;function CronOptions(options){if(options===void 0){options={}}delete options.name;options.legacyMode=options.legacyMode===void 0?true:options.legacyMode;options.paused=options.paused===void 0?false:options.paused;options.maxRuns=options.maxRuns===void 0?Infinity:options.maxRuns;options.catch=options.catch===void 0?false:options.catch;options.interval=options.interval===void 0?0:parseInt(options.interval,10);options.utcOffset=options.utcOffset===void 0?void 0:parseInt(options.utcOffset,10);options.unref=options.unref===void 0?false:options.unref;if(options.startAt){options.startAt=new CronDate(options.startAt,options.timezone)}if(options.stopAt){options.stopAt=new CronDate(options.stopAt,options.timezone)}if(options.interval!==null){if(isNaN(options.interval)){throw new Error("CronOptions: Supplied value for interval is not a number")}else if(options.interval<0){throw new Error("CronOptions: Supplied value for interval can not be negative")}}if(options.utcOffset!==void 0){if(isNaN(options.utcOffset)){throw new Error("CronOptions: Invalid value passed for utcOffset, should be number representing minutes offset from UTC.")}else if(options.utcOffset<-870||options.utcOffset>870){throw new Error("CronOptions: utcOffset out of bounds.")}if(options.utcOffset!==void 0&&options.timezone){throw new Error("CronOptions: Combining 'utcOffset' with 'timezone' is not allowed.")}}if(options.unref!==true&&options.unref!==false){throw new Error("CronOptions: Unref should be either true, false or undefined(false).")}return options}const LAST_OCCURRENCE=32;const ANY_OCCURRENCE=1|2|4|8|16|LAST_OCCURRENCE;const OCCURRENCE_BITMASKS=[1,2,4,16,16];function CronPattern(pattern,timezone){this.pattern=pattern;this.timezone=timezone;this.second=Array(60).fill(0);this.minute=Array(60).fill(0);this.hour=Array(24).fill(0);this.day=Array(31).fill(0);this.month=Array(12).fill(0);this.dayOfWeek=Array(7).fill(0);this.lastDayOfMonth=false;this.starDOM=false;this.starDOW=false;this.parse()}CronPattern.prototype.parse=function(){if(!(typeof this.pattern==="string"||this.pattern.constructor===String)){throw new TypeError("CronPattern: Pattern has to be of type string.")}if(this.pattern.indexOf("@")>=0)this.pattern=this.handleNicknames(this.pattern).trim();const parts=this.pattern.replace(/\s+/g," ").split(" ");if(parts.length<5||parts.length>6){throw new TypeError("CronPattern: invalid configuration format ('"+this.pattern+"'), exactly five or six space separated parts are required.")}if(parts.length===5){parts.unshift("0")}if(parts[3].indexOf("L")>=0){parts[3]=parts[3].replace("L","");this.lastDayOfMonth=true}if(parts[3]=="*"){this.starDOM=true}if(parts[4].length>=3)parts[4]=this.replaceAlphaMonths(parts[4]);if(parts[5].length>=3)parts[5]=this.replaceAlphaDays(parts[5]);if(parts[5]=="*"){this.starDOW=true}if(this.pattern.indexOf("?")>=0){const initDate=new CronDate(new Date,this.timezone).getDate(true);parts[0]=parts[0].replace("?",initDate.getSeconds());parts[1]=parts[1].replace("?",initDate.getMinutes());parts[2]=parts[2].replace("?",initDate.getHours());if(!this.starDOM)parts[3]=parts[3].replace("?",initDate.getDate());parts[4]=parts[4].replace("?",initDate.getMonth()+1);if(!this.starDOW)parts[5]=parts[5].replace("?",initDate.getDay())}this.throwAtIllegalCharacters(parts);this.partToArray("second",parts[0],0,1);this.partToArray("minute",parts[1],0,1);this.partToArray("hour",parts[2],0,1);this.partToArray("day",parts[3],-1,1);this.partToArray("month",parts[4],-1,1);this.partToArray("dayOfWeek",parts[5],0,ANY_OCCURRENCE);if(this.dayOfWeek[7]){this.dayOfWeek[0]=this.dayOfWeek[7]}};CronPattern.prototype.partToArray=function(type,conf,valueIndexOffset,defaultValue){const arr=this[type];const lastDayOfMonth=type==="day"&&this.lastDayOfMonth;if(conf===""&&!lastDayOfMonth)throw new TypeError("CronPattern: configuration entry "+type+" ("+conf+") is empty, check for trailing spaces.");if(conf==="*")return arr.fill(defaultValue);const split=conf.split(",");if(split.length>1){for(let i=0;i6)&&index!=="L"){throw new RangeError("CronPattern: Invalid value for dayOfWeek: "+index)}this.setNthWeekdayOfMonth(index,value);return}if(part==="second"||part==="minute"){if(index<0||index>=60){throw new RangeError("CronPattern: Invalid value for "+part+": "+index)}}else if(part==="hour"){if(index<0||index>=24){throw new RangeError("CronPattern: Invalid value for "+part+": "+index)}}else if(part==="day"){if(index<0||index>=31){throw new RangeError("CronPattern: Invalid value for "+part+": "+index)}}else if(part==="month"){if(index<0||index>=12){throw new RangeError("CronPattern: Invalid value for "+part+": "+index)}}this[part][index]=value};CronPattern.prototype.handleRangeWithStepping=function(conf,type,valueIndexOffset,defaultValue){const result=this.extractNth(conf,type);const matches=result[0].match(/^(\d+)-(\d+)\/(\d+)$/);if(matches===null)throw new TypeError("CronPattern: Syntax error, illegal range with stepping: '"+conf+"'");let[,lower,upper,steps]=matches;lower=parseInt(lower,10)+valueIndexOffset;upper=parseInt(upper,10)+valueIndexOffset;steps=parseInt(steps,10);if(isNaN(lower))throw new TypeError("CronPattern: Syntax error, illegal lower range (NaN)");if(isNaN(upper))throw new TypeError("CronPattern: Syntax error, illegal upper range (NaN)");if(isNaN(steps))throw new TypeError("CronPattern: Syntax error, illegal stepping: (NaN)");if(steps===0)throw new TypeError("CronPattern: Syntax error, illegal stepping: 0");if(steps>this[type].length)throw new TypeError("CronPattern: Syntax error, steps cannot be greater than maximum value of part ("+this[type].length+")");if(lower>upper)throw new TypeError("CronPattern: From value is larger than to value: '"+conf+"'");for(let i=lower;i<=upper;i+=steps){this.setPart(type,i,result[1]||defaultValue)}};CronPattern.prototype.extractNth=function(conf,type){let rest=conf;let nth;if(rest.includes("#")){if(type!=="dayOfWeek"){throw new Error("CronPattern: nth (#) only allowed in day-of-week field")}nth=rest.split("#")[1];rest=rest.split("#")[0]}return[rest,nth]};CronPattern.prototype.handleRange=function(conf,type,valueIndexOffset,defaultValue){const result=this.extractNth(conf,type);const split=result[0].split("-");if(split.length!==2){throw new TypeError("CronPattern: Syntax error, illegal range: '"+conf+"'")}const lower=parseInt(split[0],10)+valueIndexOffset,upper=parseInt(split[1],10)+valueIndexOffset;if(isNaN(lower)){throw new TypeError("CronPattern: Syntax error, illegal lower range (NaN)")}else if(isNaN(upper)){throw new TypeError("CronPattern: Syntax error, illegal upper range (NaN)")}if(lower>upper){throw new TypeError("CronPattern: From value is larger than to value: '"+conf+"'")}for(let i=lower;i<=upper;i++){this.setPart(type,i,result[1]||defaultValue)}};CronPattern.prototype.handleStepping=function(conf,type,valueIndexOffset,defaultValue){const result=this.extractNth(conf,type);const split=result[0].split("/");if(split.length!==2){throw new TypeError("CronPattern: Syntax error, illegal stepping: '"+conf+"'")}let start=0;if(split[0]!=="*"){start=parseInt(split[0],10)+valueIndexOffset}const steps=parseInt(split[1],10);if(isNaN(steps))throw new TypeError("CronPattern: Syntax error, illegal stepping: (NaN)");if(steps===0)throw new TypeError("CronPattern: Syntax error, illegal stepping: 0");if(steps>this[type].length)throw new TypeError("CronPattern: Syntax error, max steps for part is ("+this[type].length+")");for(let i=start;i0){this["dayOfWeek"][index]=this["dayOfWeek"][index]|OCCURRENCE_BITMASKS[nthWeekday-1]}else if(nthWeekday===ANY_OCCURRENCE){this["dayOfWeek"][index]=ANY_OCCURRENCE}else{throw new TypeError(`CronPattern: nth weekday of of range, should be 1-5 or L. Value: ${nthWeekday}`)}};const DaysOfMonth=[31,28,31,30,31,30,31,31,30,31,30,31];const RecursionSteps=[["month","year",0],["day","month",-1],["hour","day",0],["minute","hour",0],["second","minute",0]];function CronDate(d,tz){this.tz=tz;if(d&&d instanceof Date){if(!isNaN(d)){this.fromDate(d)}else{throw new TypeError("CronDate: Invalid date passed to CronDate constructor")}}else if(d===void 0){this.fromDate(new Date)}else if(d&&typeof d==="string"){this.fromString(d)}else if(d instanceof CronDate){this.fromCronDate(d)}else{throw new TypeError("CronDate: Invalid type ("+typeof d+") passed to CronDate constructor")}}CronDate.prototype.isNthWeekdayOfMonth=function(year,month,day,nth){const date=new Date(Date.UTC(year,month,day));const weekday=date.getUTCDay();let count=0;for(let d=1;d<=day;d++){if(new Date(Date.UTC(year,month,d)).getUTCDay()===weekday){count++}}if(nth&ANY_OCCURRENCE&&OCCURRENCE_BITMASKS[count-1]&nth){return true}if(nth&LAST_OCCURRENCE){const daysInMonth=new Date(Date.UTC(year,month+1,0)).getUTCDate();for(let d=day+1;d<=daysInMonth;d++){if(new Date(Date.UTC(year,month,d)).getUTCDay()===weekday){return false}}return true}return false};CronDate.prototype.fromDate=function(inDate){if(this.tz!==void 0){if(typeof this.tz==="number"){this.ms=inDate.getUTCMilliseconds();this.second=inDate.getUTCSeconds();this.minute=inDate.getUTCMinutes()+this.tz;this.hour=inDate.getUTCHours();this.day=inDate.getUTCDate();this.month=inDate.getUTCMonth();this.year=inDate.getUTCFullYear();this.apply()}else{const d=minitz.toTZ(inDate,this.tz);this.ms=inDate.getMilliseconds();this.second=d.s;this.minute=d.i;this.hour=d.h;this.day=d.d;this.month=d.m-1;this.year=d.y}}else{this.ms=inDate.getMilliseconds();this.second=inDate.getSeconds();this.minute=inDate.getMinutes();this.hour=inDate.getHours();this.day=inDate.getDate();this.month=inDate.getMonth();this.year=inDate.getFullYear()}};CronDate.prototype.fromCronDate=function(d){this.tz=d.tz;this.year=d.year;this.month=d.month;this.day=d.day;this.hour=d.hour;this.minute=d.minute;this.second=d.second;this.ms=d.ms};CronDate.prototype.apply=function(){if(this.month>11||this.day>DaysOfMonth[this.month]||this.hour>59||this.minute>59||this.second>59||this.hour<0||this.minute<0||this.second<0){const d=new Date(Date.UTC(this.year,this.month,this.day,this.hour,this.minute,this.second,this.ms));this.ms=d.getUTCMilliseconds();this.second=d.getUTCSeconds();this.minute=d.getUTCMinutes();this.hour=d.getUTCHours();this.day=d.getUTCDate();this.month=d.getUTCMonth();this.year=d.getUTCFullYear();return true}else{return false}};CronDate.prototype.fromString=function(str){if(typeof this.tz==="number"){const inDate=minitz.fromTZISO(str);this.ms=inDate.getUTCMilliseconds();this.second=inDate.getUTCSeconds();this.minute=inDate.getUTCMinutes();this.hour=inDate.getUTCHours();this.day=inDate.getUTCDate();this.month=inDate.getUTCMonth();this.year=inDate.getUTCFullYear();this.apply()}else{return this.fromDate(minitz.fromTZISO(str,this.tz))}};CronDate.prototype.findNext=function(options,target,pattern,offset){const originalTarget=this[target];let lastDayOfMonth;if(pattern.lastDayOfMonth){if(this.month!==1){lastDayOfMonth=DaysOfMonth[this.month]}else{lastDayOfMonth=new Date(Date.UTC(this.year,this.month+1,0,0,0,0,0)).getUTCDate()}}const fDomWeekDay=!pattern.starDOW&&target=="day"?new Date(Date.UTC(this.year,this.month,1,0,0,0,0)).getUTCDay():undefined;for(let i=this[target]+offset;i1){let resetLevel=doing+1;while(resetLevel=RecursionSteps.length){return this}else if(this.year>=3e3){return null}else{return this.recurse(pattern,options,doing)}};CronDate.prototype.increment=function(pattern,options,hasPreviousRun){this.second+=options.interval>1&&hasPreviousRun?options.interval:1;this.ms=0;this.apply();return this.recurse(pattern,options,0)};CronDate.prototype.getDate=function(internal){if(internal||this.tz===void 0){return new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.ms)}else{if(typeof this.tz==="number"){return new Date(Date.UTC(this.year,this.month,this.day,this.hour,this.minute-this.tz,this.second,this.ms))}else{return minitz(this.year,this.month+1,this.day,this.hour,this.minute,this.second,this.tz)}}};CronDate.prototype.getTime=function(){return this.getDate().getTime()};function isFunction(v){return Object.prototype.toString.call(v)==="[object Function]"||"function"===typeof v||v instanceof Function}function unrefTimer(timer){if(typeof Deno!=="undefined"&&typeof Deno.unrefTimer!=="undefined"){Deno.unrefTimer(timer)}else if(timer&&typeof timer.unref!=="undefined"){timer.unref()}}const maxDelay=30*1e3;const scheduledJobs=[];function Cron(pattern,fnOrOptions1,fnOrOptions2){if(!(this instanceof Cron)){return new Cron(pattern,fnOrOptions1,fnOrOptions2)}let options,func;if(isFunction(fnOrOptions1)){func=fnOrOptions1}else if(typeof fnOrOptions1==="object"){options=fnOrOptions1}else if(fnOrOptions1!==void 0){throw new Error("Cron: Invalid argument passed for optionsIn. Should be one of function, or object (options).")}if(isFunction(fnOrOptions2)){func=fnOrOptions2}else if(typeof fnOrOptions2==="object"){options=fnOrOptions2}else if(fnOrOptions2!==void 0){throw new Error("Cron: Invalid argument passed for funcIn. Should be one of function, or object (options).")}this.name=options?options.name:void 0;this.options=CronOptions(options);this._states={kill:false,blocking:false,previousRun:void 0,currentRun:void 0,once:void 0,currentTimeout:void 0,maxRuns:options?options.maxRuns:void 0,paused:options?options.paused:false,pattern:void 0};if(pattern&&(pattern instanceof Date||typeof pattern==="string"&&pattern.indexOf(":")>0)){this._states.once=new CronDate(pattern,this.options.timezone||this.options.utcOffset)}else{this._states.pattern=new CronPattern(pattern,this.options.timezone)}if(this.name){const existing=scheduledJobs.find(j=>j.name===this.name);if(existing){throw new Error("Cron: Tried to initialize new named job '"+this.name+"', but name already taken.")}else{scheduledJobs.push(this)}}if(func!==void 0){this.fn=func;this.schedule()}return this}Cron.prototype.nextRun=function(prev){const next=this._next(prev);return next?next.getDate():null};Cron.prototype.nextRuns=function(n,previous){if(n>this._states.maxRuns){n=this._states.maxRuns}const enumeration=[];let prev=previous||this._states.currentRun;while(n--&&(prev=this.nextRun(prev))){enumeration.push(prev)}return enumeration};Cron.prototype.getPattern=function(){return this._states.pattern?this._states.pattern.pattern:void 0};Cron.prototype.isRunning=function(){const nextRunTime=this.nextRun(this._states.currentRun);const isRunning=!this._states.paused;const isScheduled=this.fn!==void 0;const notIsKilled=!this._states.kill;return isRunning&&isScheduled&¬IsKilled&&nextRunTime!==null};Cron.prototype.isStopped=function(){return this._states.kill};Cron.prototype.isBusy=function(){return this._states.blocking};Cron.prototype.currentRun=function(){return this._states.currentRun?this._states.currentRun.getDate():null};Cron.prototype.previousRun=function(){return this._states.previousRun?this._states.previousRun.getDate():null};Cron.prototype.msToNext=function(prev){prev=prev||new Date;const next=this._next(prev);if(next){return next.getTime()-prev.getTime()}else{return null}};Cron.prototype.stop=function(){this._states.kill=true;if(this._states.currentTimeout){clearTimeout(this._states.currentTimeout)}const jobIndex=scheduledJobs.indexOf(this);if(jobIndex>=0){scheduledJobs.splice(jobIndex,1)}};Cron.prototype.pause=function(){this._states.paused=true;return!this._states.kill};Cron.prototype.resume=function(){this._states.paused=false;return!this._states.kill};Cron.prototype.schedule=function(func){if(func&&this.fn){throw new Error("Cron: It is not allowed to schedule two functions using the same Croner instance.")}else if(func){this.fn=func}let waitMs=this.msToNext();const target=this.nextRun(this._states.currentRun);if(waitMs===null||waitMs===undefined||isNaN(waitMs)||target===null)return this;if(waitMs>maxDelay){waitMs=maxDelay}this._states.currentTimeout=setTimeout(()=>this._checkTrigger(target),waitMs);if(this._states.currentTimeout&&this.options.unref){unrefTimer(this._states.currentTimeout)}return this};Cron.prototype._trigger=async function(initiationDate){this._states.blocking=true;this._states.currentRun=new CronDate(void 0,this.options.timezone||this.options.utcOffset);if(this.options.catch){try{await this.fn(this,this.options.context)}catch(_e){if(isFunction(this.options.catch)){this.options.catch(_e,this)}}}else{await this.fn(this,this.options.context)}this._states.previousRun=new CronDate(initiationDate,this.options.timezone||this.options.utcOffset);this._states.blocking=false};Cron.prototype.trigger=async function(){await this._trigger()};Cron.prototype._checkTrigger=function(target){const now=new Date,shouldRun=!this._states.paused&&now.getTime()>=target,isBlocked=this._states.blocking&&this.options.protect;if(shouldRun&&!isBlocked){this._states.maxRuns--;this._trigger()}else{if(shouldRun&&isBlocked&&isFunction(this.options.protect)){setTimeout(()=>this.options.protect(this),0)}}this.schedule()};Cron.prototype._next=function(prev){const hasPreviousRun=prev||this._states.currentRun?true:false;prev=new CronDate(prev,this.options.timezone||this.options.utcOffset);if(this.options.startAt&&prev&&prev.getTime()=this.options.stopAt.getTime()){return null}else{return nextRun}};Cron.Cron=Cron;Cron.scheduledJobs=scheduledJobs;export{Cron,Cron as default,scheduledJobs}; \ No newline at end of file +function minitz(y,m,d,h,i,s,tz,throwOnInvalid){return minitz.fromTZ(minitz.tp(y,m,d,h,i,s,tz),throwOnInvalid)}minitz.fromTZISO=(localTimeStr,tz,throwOnInvalid)=>{return minitz.fromTZ(parseISOLocal(localTimeStr,tz),throwOnInvalid)};minitz.fromTZ=function(tp,throwOnInvalid){const inDate=new Date(Date.UTC(tp.y,tp.m-1,tp.d,tp.h,tp.i,tp.s)),offset=getTimezoneOffset(tp.tz,inDate),dateGuess=new Date(inDate.getTime()-offset),dateOffsGuess=getTimezoneOffset(tp.tz,dateGuess);if(dateOffsGuess-offset===0){return dateGuess}else{const dateGuess2=new Date(inDate.getTime()-dateOffsGuess),dateOffsGuess2=getTimezoneOffset(tp.tz,dateGuess2);if(dateOffsGuess2-dateOffsGuess===0){return dateGuess2}else if(!throwOnInvalid&&dateOffsGuess2-dateOffsGuess>0){return dateGuess2}else if(!throwOnInvalid){return dateGuess}else{throw new Error("Invalid date passed to fromTZ()")}}};minitz.toTZ=function(d,tzStr){const localDateString=d.toLocaleString("en-US",{timeZone:tzStr}).replace(/[\u202f]/," ");const td=new Date(localDateString);return{y:td.getFullYear(),m:td.getMonth()+1,d:td.getDate(),h:td.getHours(),i:td.getMinutes(),s:td.getSeconds(),tz:tzStr}};minitz.tp=(y,m,d,h,i,s,tz)=>{return{y:y,m:m,d:d,h:h,i:i,s:s,tz:tz}};function getTimezoneOffset(timeZone,date=new Date){const tz=date.toLocaleString("en-US",{timeZone:timeZone,timeZoneName:"shortOffset"}).split(" ").slice(-1)[0];const dateString=date.toLocaleString("en-US").replace(/[\u202f]/," ");return Date.parse(`${dateString} GMT`)-Date.parse(`${dateString} ${tz}`)}function parseISOLocal(dtStr,tz){const pd=new Date(Date.parse(dtStr));if(isNaN(pd)){throw new Error("minitz: Invalid ISO8601 passed to parser.")}const stringEnd=dtStr.substring(9);if(dtStr.includes("Z")||stringEnd.includes("-")||stringEnd.includes("+")){return minitz.tp(pd.getUTCFullYear(),pd.getUTCMonth()+1,pd.getUTCDate(),pd.getUTCHours(),pd.getUTCMinutes(),pd.getUTCSeconds(),"Etc/UTC")}else{return minitz.tp(pd.getFullYear(),pd.getMonth()+1,pd.getDate(),pd.getHours(),pd.getMinutes(),pd.getSeconds(),tz)}}minitz.minitz=minitz;function CronOptions(options){if(options===void 0){options={}}delete options.name;options.legacyMode=options.legacyMode===void 0?true:options.legacyMode;options.paused=options.paused===void 0?false:options.paused;options.maxRuns=options.maxRuns===void 0?Infinity:options.maxRuns;options.catch=options.catch===void 0?false:options.catch;options.interval=options.interval===void 0?0:parseInt(options.interval,10);options.utcOffset=options.utcOffset===void 0?void 0:parseInt(options.utcOffset,10);options.unref=options.unref===void 0?false:options.unref;if(options.startAt){options.startAt=new CronDate(options.startAt,options.timezone)}if(options.stopAt){options.stopAt=new CronDate(options.stopAt,options.timezone)}if(options.interval!==null){if(isNaN(options.interval)){throw new Error("CronOptions: Supplied value for interval is not a number")}else if(options.interval<0){throw new Error("CronOptions: Supplied value for interval can not be negative")}}if(options.utcOffset!==void 0){if(isNaN(options.utcOffset)){throw new Error("CronOptions: Invalid value passed for utcOffset, should be number representing minutes offset from UTC.")}else if(options.utcOffset<-870||options.utcOffset>870){throw new Error("CronOptions: utcOffset out of bounds.")}if(options.utcOffset!==void 0&&options.timezone){throw new Error("CronOptions: Combining 'utcOffset' with 'timezone' is not allowed.")}}if(options.unref!==true&&options.unref!==false){throw new Error("CronOptions: Unref should be either true, false or undefined(false).")}return options}const LAST_OCCURRENCE=32;const ANY_OCCURRENCE=1|2|4|8|16|LAST_OCCURRENCE;const OCCURRENCE_BITMASKS=[1,2,4,16,16];function CronPattern(pattern,timezone){this.pattern=pattern;this.timezone=timezone;this.second=Array(60).fill(0);this.minute=Array(60).fill(0);this.hour=Array(24).fill(0);this.day=Array(31).fill(0);this.month=Array(12).fill(0);this.dayOfWeek=Array(7).fill(0);this.lastDayOfMonth=false;this.starDOM=false;this.starDOW=false;this.parse()}CronPattern.prototype.parse=function(){if(!(typeof this.pattern==="string"||this.pattern.constructor===String)){throw new TypeError("CronPattern: Pattern has to be of type string.")}if(this.pattern.indexOf("@")>=0)this.pattern=this.handleNicknames(this.pattern).trim();const parts=this.pattern.replace(/\s+/g," ").split(" ");if(parts.length<5||parts.length>6){throw new TypeError("CronPattern: invalid configuration format ('"+this.pattern+"'), exactly five or six space separated parts are required.")}if(parts.length===5){parts.unshift("0")}if(parts[3].indexOf("L")>=0){parts[3]=parts[3].replace("L","");this.lastDayOfMonth=true}if(parts[3]=="*"){this.starDOM=true}if(parts[4].length>=3)parts[4]=this.replaceAlphaMonths(parts[4]);if(parts[5].length>=3)parts[5]=this.replaceAlphaDays(parts[5]);if(parts[5]=="*"){this.starDOW=true}if(this.pattern.indexOf("?")>=0){const initDate=new CronDate(new Date,this.timezone).getDate(true);parts[0]=parts[0].replace("?",initDate.getSeconds());parts[1]=parts[1].replace("?",initDate.getMinutes());parts[2]=parts[2].replace("?",initDate.getHours());if(!this.starDOM)parts[3]=parts[3].replace("?",initDate.getDate());parts[4]=parts[4].replace("?",initDate.getMonth()+1);if(!this.starDOW)parts[5]=parts[5].replace("?",initDate.getDay())}this.throwAtIllegalCharacters(parts);this.partToArray("second",parts[0],0,1);this.partToArray("minute",parts[1],0,1);this.partToArray("hour",parts[2],0,1);this.partToArray("day",parts[3],-1,1);this.partToArray("month",parts[4],-1,1);this.partToArray("dayOfWeek",parts[5],0,ANY_OCCURRENCE);if(this.dayOfWeek[7]){this.dayOfWeek[0]=this.dayOfWeek[7]}};CronPattern.prototype.partToArray=function(type,conf,valueIndexOffset,defaultValue){const arr=this[type];const lastDayOfMonth=type==="day"&&this.lastDayOfMonth;if(conf===""&&!lastDayOfMonth)throw new TypeError("CronPattern: configuration entry "+type+" ("+conf+") is empty, check for trailing spaces.");if(conf==="*")return arr.fill(defaultValue);const split=conf.split(",");if(split.length>1){for(let i=0;i6)&&index!=="L"){throw new RangeError("CronPattern: Invalid value for dayOfWeek: "+index)}this.setNthWeekdayOfMonth(index,value);return}if(part==="second"||part==="minute"){if(index<0||index>=60){throw new RangeError("CronPattern: Invalid value for "+part+": "+index)}}else if(part==="hour"){if(index<0||index>=24){throw new RangeError("CronPattern: Invalid value for "+part+": "+index)}}else if(part==="day"){if(index<0||index>=31){throw new RangeError("CronPattern: Invalid value for "+part+": "+index)}}else if(part==="month"){if(index<0||index>=12){throw new RangeError("CronPattern: Invalid value for "+part+": "+index)}}this[part][index]=value};CronPattern.prototype.handleRangeWithStepping=function(conf,type,valueIndexOffset,defaultValue){const result=this.extractNth(conf,type);const matches=result[0].match(/^(\d+)-(\d+)\/(\d+)$/);if(matches===null)throw new TypeError("CronPattern: Syntax error, illegal range with stepping: '"+conf+"'");let[,lower,upper,steps]=matches;lower=parseInt(lower,10)+valueIndexOffset;upper=parseInt(upper,10)+valueIndexOffset;steps=parseInt(steps,10);if(isNaN(lower))throw new TypeError("CronPattern: Syntax error, illegal lower range (NaN)");if(isNaN(upper))throw new TypeError("CronPattern: Syntax error, illegal upper range (NaN)");if(isNaN(steps))throw new TypeError("CronPattern: Syntax error, illegal stepping: (NaN)");if(steps===0)throw new TypeError("CronPattern: Syntax error, illegal stepping: 0");if(steps>this[type].length)throw new TypeError("CronPattern: Syntax error, steps cannot be greater than maximum value of part ("+this[type].length+")");if(lower>upper)throw new TypeError("CronPattern: From value is larger than to value: '"+conf+"'");for(let i=lower;i<=upper;i+=steps){this.setPart(type,i,result[1]||defaultValue)}};CronPattern.prototype.extractNth=function(conf,type){let rest=conf;let nth;if(rest.includes("#")){if(type!=="dayOfWeek"){throw new Error("CronPattern: nth (#) only allowed in day-of-week field")}nth=rest.split("#")[1];rest=rest.split("#")[0]}return[rest,nth]};CronPattern.prototype.handleRange=function(conf,type,valueIndexOffset,defaultValue){const result=this.extractNth(conf,type);const split=result[0].split("-");if(split.length!==2){throw new TypeError("CronPattern: Syntax error, illegal range: '"+conf+"'")}const lower=parseInt(split[0],10)+valueIndexOffset,upper=parseInt(split[1],10)+valueIndexOffset;if(isNaN(lower)){throw new TypeError("CronPattern: Syntax error, illegal lower range (NaN)")}else if(isNaN(upper)){throw new TypeError("CronPattern: Syntax error, illegal upper range (NaN)")}if(lower>upper){throw new TypeError("CronPattern: From value is larger than to value: '"+conf+"'")}for(let i=lower;i<=upper;i++){this.setPart(type,i,result[1]||defaultValue)}};CronPattern.prototype.handleStepping=function(conf,type,valueIndexOffset,defaultValue){const result=this.extractNth(conf,type);const split=result[0].split("/");if(split.length!==2){throw new TypeError("CronPattern: Syntax error, illegal stepping: '"+conf+"'")}let start=0;if(split[0]!=="*"){start=parseInt(split[0],10)+valueIndexOffset}const steps=parseInt(split[1],10);if(isNaN(steps))throw new TypeError("CronPattern: Syntax error, illegal stepping: (NaN)");if(steps===0)throw new TypeError("CronPattern: Syntax error, illegal stepping: 0");if(steps>this[type].length)throw new TypeError("CronPattern: Syntax error, max steps for part is ("+this[type].length+")");for(let i=start;i0){this["dayOfWeek"][index]=this["dayOfWeek"][index]|OCCURRENCE_BITMASKS[nthWeekday-1]}else if(nthWeekday===ANY_OCCURRENCE){this["dayOfWeek"][index]=ANY_OCCURRENCE}else{throw new TypeError(`CronPattern: nth weekday of of range, should be 1-5 or L. Value: ${nthWeekday}`)}};const DaysOfMonth=[31,28,31,30,31,30,31,31,30,31,30,31];const RecursionSteps=[["month","year",0],["day","month",-1],["hour","day",0],["minute","hour",0],["second","minute",0]];function CronDate(d,tz){this.tz=tz;if(d&&d instanceof Date){if(!isNaN(d)){this.fromDate(d)}else{throw new TypeError("CronDate: Invalid date passed to CronDate constructor")}}else if(d===void 0){this.fromDate(new Date)}else if(d&&typeof d==="string"){this.fromString(d)}else if(d instanceof CronDate){this.fromCronDate(d)}else{throw new TypeError("CronDate: Invalid type ("+typeof d+") passed to CronDate constructor")}}CronDate.prototype.isNthWeekdayOfMonth=function(year,month,day,nth){const date=new Date(Date.UTC(year,month,day));const weekday=date.getUTCDay();let count=0;for(let d=1;d<=day;d++){if(new Date(Date.UTC(year,month,d)).getUTCDay()===weekday){count++}}if(nth&ANY_OCCURRENCE&&OCCURRENCE_BITMASKS[count-1]&nth){return true}if(nth&LAST_OCCURRENCE){const daysInMonth=new Date(Date.UTC(year,month+1,0)).getUTCDate();for(let d=day+1;d<=daysInMonth;d++){if(new Date(Date.UTC(year,month,d)).getUTCDay()===weekday){return false}}return true}return false};CronDate.prototype.fromDate=function(inDate){if(this.tz!==void 0){if(typeof this.tz==="number"){this.ms=inDate.getUTCMilliseconds();this.second=inDate.getUTCSeconds();this.minute=inDate.getUTCMinutes()+this.tz;this.hour=inDate.getUTCHours();this.day=inDate.getUTCDate();this.month=inDate.getUTCMonth();this.year=inDate.getUTCFullYear();this.apply()}else{const d=minitz.toTZ(inDate,this.tz);this.ms=inDate.getMilliseconds();this.second=d.s;this.minute=d.i;this.hour=d.h;this.day=d.d;this.month=d.m-1;this.year=d.y}}else{this.ms=inDate.getMilliseconds();this.second=inDate.getSeconds();this.minute=inDate.getMinutes();this.hour=inDate.getHours();this.day=inDate.getDate();this.month=inDate.getMonth();this.year=inDate.getFullYear()}};CronDate.prototype.fromCronDate=function(d){this.tz=d.tz;this.year=d.year;this.month=d.month;this.day=d.day;this.hour=d.hour;this.minute=d.minute;this.second=d.second;this.ms=d.ms};CronDate.prototype.apply=function(){if(this.month>11||this.day>DaysOfMonth[this.month]||this.hour>59||this.minute>59||this.second>59||this.hour<0||this.minute<0||this.second<0){const d=new Date(Date.UTC(this.year,this.month,this.day,this.hour,this.minute,this.second,this.ms));this.ms=d.getUTCMilliseconds();this.second=d.getUTCSeconds();this.minute=d.getUTCMinutes();this.hour=d.getUTCHours();this.day=d.getUTCDate();this.month=d.getUTCMonth();this.year=d.getUTCFullYear();return true}else{return false}};CronDate.prototype.fromString=function(str){if(typeof this.tz==="number"){const inDate=minitz.fromTZISO(str);this.ms=inDate.getUTCMilliseconds();this.second=inDate.getUTCSeconds();this.minute=inDate.getUTCMinutes();this.hour=inDate.getUTCHours();this.day=inDate.getUTCDate();this.month=inDate.getUTCMonth();this.year=inDate.getUTCFullYear();this.apply()}else{return this.fromDate(minitz.fromTZISO(str,this.tz))}};CronDate.prototype.findNext=function(options,target,pattern,offset){const originalTarget=this[target];let lastDayOfMonth;if(pattern.lastDayOfMonth){if(this.month!==1){lastDayOfMonth=DaysOfMonth[this.month]}else{lastDayOfMonth=new Date(Date.UTC(this.year,this.month+1,0,0,0,0,0)).getUTCDate()}}const fDomWeekDay=!pattern.starDOW&&target=="day"?new Date(Date.UTC(this.year,this.month,1,0,0,0,0)).getUTCDay():undefined;for(let i=this[target]+offset;i1){let resetLevel=doing+1;while(resetLevel=RecursionSteps.length){return this}else if(this.year>=3e3){return null}else{return this.recurse(pattern,options,doing)}};CronDate.prototype.increment=function(pattern,options,hasPreviousRun){this.second+=options.interval>1&&hasPreviousRun?options.interval:1;this.ms=0;this.apply();return this.recurse(pattern,options,0)};CronDate.prototype.getDate=function(internal){if(internal||this.tz===void 0){return new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.ms)}else{if(typeof this.tz==="number"){return new Date(Date.UTC(this.year,this.month,this.day,this.hour,this.minute-this.tz,this.second,this.ms))}else{return minitz(this.year,this.month+1,this.day,this.hour,this.minute,this.second,this.tz)}}};CronDate.prototype.getTime=function(){return this.getDate().getTime()};function isFunction(v){return Object.prototype.toString.call(v)==="[object Function]"||"function"===typeof v||v instanceof Function}function unrefTimer(timer){if(typeof Deno!=="undefined"&&typeof Deno.unrefTimer!=="undefined"){Deno.unrefTimer(timer)}else if(timer&&typeof timer.unref!=="undefined"){timer.unref()}}const maxDelay=30*1e3;const scheduledJobs=[];function Cron(pattern,fnOrOptions1,fnOrOptions2){if(!(this instanceof Cron)){return new Cron(pattern,fnOrOptions1,fnOrOptions2)}let options,func;if(isFunction(fnOrOptions1)){func=fnOrOptions1}else if(typeof fnOrOptions1==="object"){options=fnOrOptions1}else if(fnOrOptions1!==void 0){throw new Error("Cron: Invalid argument passed for optionsIn. Should be one of function, or object (options).")}if(isFunction(fnOrOptions2)){func=fnOrOptions2}else if(typeof fnOrOptions2==="object"){options=fnOrOptions2}else if(fnOrOptions2!==void 0){throw new Error("Cron: Invalid argument passed for funcIn. Should be one of function, or object (options).")}this.name=options?options.name:void 0;this.options=CronOptions(options);this._states={kill:false,blocking:false,previousRun:void 0,currentRun:void 0,once:void 0,currentTimeout:void 0,maxRuns:options?options.maxRuns:void 0,paused:options?options.paused:false,pattern:void 0};if(pattern&&(pattern instanceof Date||typeof pattern==="string"&&pattern.indexOf(":")>0)){this._states.once=new CronDate(pattern,this.options.timezone||this.options.utcOffset)}else{this._states.pattern=new CronPattern(pattern,this.options.timezone)}if(this.name){const existing=scheduledJobs.find(j=>j.name===this.name);if(existing){throw new Error("Cron: Tried to initialize new named job '"+this.name+"', but name already taken.")}else{scheduledJobs.push(this)}}if(func!==void 0){this.fn=func;this.schedule()}return this}Cron.prototype.nextRun=function(prev){const next=this._next(prev);return next?next.getDate():null};Cron.prototype.nextRuns=function(n,previous){if(n>this._states.maxRuns){n=this._states.maxRuns}const enumeration=[];let prev=previous||this._states.currentRun;while(n--&&(prev=this.nextRun(prev))){enumeration.push(prev)}return enumeration};Cron.prototype.getPattern=function(){return this._states.pattern?this._states.pattern.pattern:void 0};Cron.prototype.isRunning=function(){const nextRunTime=this.nextRun(this._states.currentRun);const isRunning=!this._states.paused;const isScheduled=this.fn!==void 0;const notIsKilled=!this._states.kill;return isRunning&&isScheduled&¬IsKilled&&nextRunTime!==null};Cron.prototype.isStopped=function(){return this._states.kill};Cron.prototype.isBusy=function(){return this._states.blocking};Cron.prototype.currentRun=function(){return this._states.currentRun?this._states.currentRun.getDate():null};Cron.prototype.previousRun=function(){return this._states.previousRun?this._states.previousRun.getDate():null};Cron.prototype.msToNext=function(prev){prev=prev||new Date;const next=this._next(prev);if(next){return next.getTime()-prev.getTime()}else{return null}};Cron.prototype.stop=function(){this._states.kill=true;if(this._states.currentTimeout){clearTimeout(this._states.currentTimeout)}const jobIndex=scheduledJobs.indexOf(this);if(jobIndex>=0){scheduledJobs.splice(jobIndex,1)}};Cron.prototype.pause=function(){this._states.paused=true;return!this._states.kill};Cron.prototype.resume=function(){this._states.paused=false;return!this._states.kill};Cron.prototype.schedule=function(func){if(func&&this.fn){throw new Error("Cron: It is not allowed to schedule two functions using the same Croner instance.")}else if(func){this.fn=func}let waitMs=this.msToNext();const target=this.nextRun(this._states.currentRun);if(waitMs===null||waitMs===undefined||isNaN(waitMs)||target===null)return this;if(waitMs>maxDelay){waitMs=maxDelay}this._states.currentTimeout=setTimeout(()=>this._checkTrigger(target),waitMs);if(this._states.currentTimeout&&this.options.unref){unrefTimer(this._states.currentTimeout)}return this};Cron.prototype._trigger=async function(initiationDate){this._states.blocking=true;this._states.currentRun=new CronDate(void 0,this.options.timezone||this.options.utcOffset);if(this.options.catch){try{await this.fn(this,this.options.context)}catch(_e){if(isFunction(this.options.catch)){this.options.catch(_e,this)}}}else{await this.fn(this,this.options.context)}this._states.previousRun=new CronDate(initiationDate,this.options.timezone||this.options.utcOffset);this._states.blocking=false};Cron.prototype.trigger=async function(){await this._trigger()};Cron.prototype._checkTrigger=function(target){const now=new Date,shouldRun=!this._states.paused&&now.getTime()>=target,isBlocked=this._states.blocking&&this.options.protect;if(shouldRun&&!isBlocked){this._states.maxRuns--;this._trigger()}else{if(shouldRun&&isBlocked&&isFunction(this.options.protect)){setTimeout(()=>this.options.protect(this),0)}}this.schedule()};Cron.prototype._next=function(prev){let hasPreviousRun=prev||this._states.currentRun?true:false;if(!prev&&this.options.startAt&&this.options.interval){prev=this.options.startAt;const now=new CronDate(undefined,this.options.timezone||this.options.utcOffset);let prevTimePlusInterval=prev.getTime()+this.options.interval*1e3;while(prevTimePlusInterval<=now.getTime()){prev=new CronDate(prev,this.options.timezone||this.options.utcOffset).increment(this._states.pattern,this.options,true);prevTimePlusInterval=prev.getTime()+this.options.interval*1e3}hasPreviousRun=true}prev=new CronDate(prev,this.options.timezone||this.options.utcOffset);if(this.options.startAt&&prev&&prev.getTime()=this.options.stopAt.getTime()){return null}else{return nextRun}};Cron.Cron=Cron;Cron.scheduledJobs=scheduledJobs;export{Cron,Cron as default,scheduledJobs}; \ No newline at end of file diff --git a/dist/croner.min.js.map b/dist/croner.min.js.map index aca144f..dd24180 100644 --- a/dist/croner.min.js.map +++ b/dist/croner.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["dist/croner.js"],"names":["minitz","y","m","d","h","i","s","tz","throwOnInvalid","fromTZ","tp","fromTZISO","localTimeStr","parseISOLocal","inDate","Date","UTC","offset","getTimezoneOffset","dateGuess","getTime","dateOffsGuess","dateGuess2","dateOffsGuess2","Error","toTZ","tzStr","localDateString","toLocaleString","timeZone","replace","td","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","date","timeZoneName","split","slice","dateString","parse","dtStr","pd","isNaN","stringEnd","substring","includes","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","CronOptions","options","name","legacyMode","paused","maxRuns","Infinity","catch","interval","parseInt","utcOffset","unref","startAt","CronDate","timezone","stopAt","LAST_OCCURRENCE","ANY_OCCURRENCE","OCCURRENCE_BITMASKS","CronPattern","pattern","this","second","Array","fill","minute","hour","day","month","dayOfWeek","lastDayOfMonth","starDOM","starDOW","prototype","constructor","String","TypeError","indexOf","handleNicknames","trim","parts","length","unshift","replaceAlphaMonths","replaceAlphaDays","initDate","getDay","throwAtIllegalCharacters","partToArray","type","conf","valueIndexOffset","defaultValue","arr","let","handleRangeWithStepping","handleRange","handleStepping","handleNumber","reValidCron","test","result","extractNth","setPart","part","index","value","Object","hasOwnProperty","call","RangeError","setNthWeekdayOfMonth","matches","match","lower","upper","steps","rest","nth","start","cleanPattern","toLowerCase","nthWeekday","DaysOfMonth","RecursionSteps","fromDate","fromString","fromCronDate","isNthWeekdayOfMonth","year","weekday","getUTCDay","count","daysInMonth","ms","getUTCMilliseconds","apply","getMilliseconds","str","findNext","target","originalTarget","fDomWeekDay","undefined","dowMatch","recurse","doing","res","resetLevel","increment","hasPreviousRun","internal","isFunction","v","toString","Function","unrefTimer","timer","Deno","maxDelay","scheduledJobs","Cron","fnOrOptions1","fnOrOptions2","func","_states","kill","blocking","previousRun","currentRun","once","currentTimeout","existing","find","j","push","fn","schedule","nextRun","prev","next","_next","nextRuns","n","previous","enumeration","getPattern","isRunning","nextRunTime","isScheduled","notIsKilled","isStopped","isBusy","msToNext","stop","clearTimeout","jobIndex","splice","pause","resume","waitMs","setTimeout","_checkTrigger","_trigger","async","initiationDate","await","context","_e","trigger","now","shouldRun","isBlocked","protect"],"mappings":"AA6DC,SAASA,OAAOC,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,GAAIC,gBACtC,OAAOR,OAAOS,OAAOT,OAAOU,GAAGT,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,EAAE,EAAGC,cAAc,CACrE,CAgBAR,OAAOW,UAAY,CAACC,aAAcL,GAAIC,kBACrC,OAAOR,OAAOS,OAAOI,cAAcD,aAAcL,EAAE,EAAGC,cAAc,CACrE,EAcAR,OAAOS,OAAS,SAASC,GAAIF,gBAE5B,MAGCM,OAAS,IAAIC,KAAKA,KAAKC,IACtBN,GAAGT,EACHS,GAAGR,EAAI,EACPQ,GAAGP,EACHO,GAAGN,EACHM,GAAGL,EACHK,GAAGJ,CACJ,CAAC,EAGDW,OAASC,kBAAkBR,GAAGH,GAAIO,MAAM,EAGxCK,UAAY,IAAIJ,KAA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EAAIyD,KAAKpB,QAAQW,QAAQhD,QAAQ,EAAG,CACpF+K,KAAOtH,KAAKpB,QAAQW,OACrB,CAGA,MAAM8H,QAAUrH,KAAKwG,QAAQK,MAC5B,IAAIrH,SAAS8H,KAAMtH,KAAKpB,QAAQa,UAAYO,KAAKpB,QAAQS,SAAS,EAAEmG,UACnExF,KAAKwG,QAAQzG,QACbC,KAAKpB,QACL6G,cACD,EAED,GAAIzF,KAAKwG,QAAQK,MAAQ7G,KAAKwG,QAAQK,KAAKtK,QAAQ,GAAK+K,KAAK/K,QAAQ,EAAG,CACvE,OAAO,IACR,MAAO,GACL8K,UAAY,MACZrH,KAAKwG,QAAQxH,SAAW,GACxBgB,KAAKwG,QAAY,MACjBxG,KAAKpB,QAAQc,QAAU2H,QAAQ9K,QAAQ,GAAKyD,KAAKpB,QAAQc,OAAOnD,QAAQ,EACxE,CACD,OAAO,IACR,KAAO,CAEN,OAAO8K,OACR,CACD,EAEAjB,KAAKA,KAAOA,KACZA,KAAKD,cAAgBA,qBAEZC,KAAMA,gBAAiBD,aAAe"} \ No newline at end of file +{"version":3,"sources":["dist/croner.js"],"names":["minitz","y","m","d","h","i","s","tz","throwOnInvalid","fromTZ","tp","fromTZISO","localTimeStr","parseISOLocal","inDate","Date","UTC","offset","getTimezoneOffset","dateGuess","getTime","dateOffsGuess","dateGuess2","dateOffsGuess2","Error","toTZ","tzStr","localDateString","toLocaleString","timeZone","replace","td","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","date","timeZoneName","split","slice","dateString","parse","dtStr","pd","isNaN","stringEnd","substring","includes","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","CronOptions","options","name","legacyMode","paused","maxRuns","Infinity","catch","interval","parseInt","utcOffset","unref","startAt","CronDate","timezone","stopAt","LAST_OCCURRENCE","ANY_OCCURRENCE","OCCURRENCE_BITMASKS","CronPattern","pattern","this","second","Array","fill","minute","hour","day","month","dayOfWeek","lastDayOfMonth","starDOM","starDOW","prototype","constructor","String","TypeError","indexOf","handleNicknames","trim","parts","length","unshift","replaceAlphaMonths","replaceAlphaDays","initDate","getDay","throwAtIllegalCharacters","partToArray","type","conf","valueIndexOffset","defaultValue","arr","let","handleRangeWithStepping","handleRange","handleStepping","handleNumber","reValidCron","test","result","extractNth","setPart","part","index","value","Object","hasOwnProperty","call","RangeError","setNthWeekdayOfMonth","matches","match","lower","upper","steps","rest","nth","start","cleanPattern","toLowerCase","nthWeekday","DaysOfMonth","RecursionSteps","fromDate","fromString","fromCronDate","isNthWeekdayOfMonth","year","weekday","getUTCDay","count","daysInMonth","ms","getUTCMilliseconds","apply","getMilliseconds","str","findNext","target","originalTarget","fDomWeekDay","undefined","dowMatch","recurse","doing","res","resetLevel","increment","hasPreviousRun","internal","isFunction","v","toString","Function","unrefTimer","timer","Deno","maxDelay","scheduledJobs","Cron","fnOrOptions1","fnOrOptions2","func","_states","kill","blocking","previousRun","currentRun","once","currentTimeout","existing","find","j","push","fn","schedule","nextRun","prev","next","_next","nextRuns","n","previous","enumeration","getPattern","isRunning","nextRunTime","isScheduled","notIsKilled","isStopped","isBusy","msToNext","stop","clearTimeout","jobIndex","splice","pause","resume","waitMs","setTimeout","_checkTrigger","_trigger","async","initiationDate","await","context","_e","trigger","now","shouldRun","isBlocked","protect","prevTimePlusInterval"],"mappings":"AA6DC,SAASA,OAAOC,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,GAAIC,gBACtC,OAAOR,OAAOS,OAAOT,OAAOU,GAAGT,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,EAAE,EAAGC,cAAc,CACrE,CAgBAR,OAAOW,UAAY,CAACC,aAAcL,GAAIC,kBACrC,OAAOR,OAAOS,OAAOI,cAAcD,aAAcL,EAAE,EAAGC,cAAc,CACrE,EAcAR,OAAOS,OAAS,SAASC,GAAIF,gBAE5B,MAGCM,OAAS,IAAIC,KAAKA,KAAKC,IACtBN,GAAGT,EACHS,GAAG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QAAQ,EACxE,CACD,OAAO,IACR,KAAO,CAEN,OAAO8K,OACR,CACD,EAEAjB,KAAKA,KAAOA,KACZA,KAAKD,cAAgBA,qBAEZC,KAAMA,gBAAiBD,aAAe"} \ No newline at end of file diff --git a/dist/croner.umd.js b/dist/croner.umd.js index ffd2490..1294674 100644 --- a/dist/croner.umd.js +++ b/dist/croner.umd.js @@ -1828,7 +1828,19 @@ * @returns {CronDate | null} - Next run time */ Cron.prototype._next = function (prev) { - const hasPreviousRun = (prev || this._states.currentRun) ? true : false; + let hasPreviousRun = (prev || this._states.currentRun) ? true : false; + + // If no previous run, and startAt and interval is set, calculate when the last run should have been + if (!prev && this.options.startAt && this.options.interval) { + prev = this.options.startAt; + const now = new CronDate(undefined, this.options.timezone || this.options.utcOffset); + let prevTimePlusInterval = prev.getTime() + this.options.interval * 1000; + while (prevTimePlusInterval <= now.getTime()) { + prev = new CronDate(prev, this.options.timezone || this.options.utcOffset).increment(this._states.pattern, this.options, true); + prevTimePlusInterval = prev.getTime() + this.options.interval * 1000; + } + hasPreviousRun = true; + } // Ensure previous run is a CronDate prev = new CronDate(prev, this.options.timezone || this.options.utcOffset); diff --git a/dist/croner.umd.min.js b/dist/croner.umd.min.js index 6361817..a5795fb 100644 --- a/dist/croner.umd.min.js +++ b/dist/croner.umd.min.js @@ -1 +1 @@ -(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?module.exports=factory():typeof define==="function"&&define.amd?define(factory):(global=typeof globalThis!=="undefined"?globalThis:global||self,global.Cron=factory())})(this,function(){"use strict";function minitz(y,m,d,h,i,s,tz,throwOnInvalid){return minitz.fromTZ(minitz.tp(y,m,d,h,i,s,tz),throwOnInvalid)}minitz.fromTZISO=(localTimeStr,tz,throwOnInvalid)=>{return minitz.fromTZ(parseISOLocal(localTimeStr,tz),throwOnInvalid)};minitz.fromTZ=function(tp,throwOnInvalid){const inDate=new Date(Date.UTC(tp.y,tp.m-1,tp.d,tp.h,tp.i,tp.s)),offset=getTimezoneOffset(tp.tz,inDate),dateGuess=new Date(inDate.getTime()-offset),dateOffsGuess=getTimezoneOffset(tp.tz,dateGuess);if(dateOffsGuess-offset===0){return dateGuess}else{const dateGuess2=new Date(inDate.getTime()-dateOffsGuess),dateOffsGuess2=getTimezoneOffset(tp.tz,dateGuess2);if(dateOffsGuess2-dateOffsGuess===0){return dateGuess2}else if(!throwOnInvalid&&dateOffsGuess2-dateOffsGuess>0){return dateGuess2}else if(!throwOnInvalid){return dateGuess}else{throw new Error("Invalid date passed to fromTZ()")}}};minitz.toTZ=function(d,tzStr){const localDateString=d.toLocaleString("en-US",{timeZone:tzStr}).replace(/[\u202f]/," ");const td=new Date(localDateString);return{y:td.getFullYear(),m:td.getMonth()+1,d:td.getDate(),h:td.getHours(),i:td.getMinutes(),s:td.getSeconds(),tz:tzStr}};minitz.tp=(y,m,d,h,i,s,tz)=>{return{y:y,m:m,d:d,h:h,i:i,s:s,tz:tz}};function getTimezoneOffset(timeZone,date=new Date){const tz=date.toLocaleString("en-US",{timeZone:timeZone,timeZoneName:"shortOffset"}).split(" ").slice(-1)[0];const dateString=date.toLocaleString("en-US").replace(/[\u202f]/," ");return Date.parse(`${dateString} GMT`)-Date.parse(`${dateString} ${tz}`)}function parseISOLocal(dtStr,tz){const pd=new Date(Date.parse(dtStr));if(isNaN(pd)){throw new Error("minitz: Invalid ISO8601 passed to parser.")}const stringEnd=dtStr.substring(9);if(dtStr.includes("Z")||stringEnd.includes("-")||stringEnd.includes("+")){return minitz.tp(pd.getUTCFullYear(),pd.getUTCMonth()+1,pd.getUTCDate(),pd.getUTCHours(),pd.getUTCMinutes(),pd.getUTCSeconds(),"Etc/UTC")}else{return minitz.tp(pd.getFullYear(),pd.getMonth()+1,pd.getDate(),pd.getHours(),pd.getMinutes(),pd.getSeconds(),tz)}}minitz.minitz=minitz;function CronOptions(options){if(options===void 0){options={}}delete options.name;options.legacyMode=options.legacyMode===void 0?true:options.legacyMode;options.paused=options.paused===void 0?false:options.paused;options.maxRuns=options.maxRuns===void 0?Infinity:options.maxRuns;options.catch=options.catch===void 0?false:options.catch;options.interval=options.interval===void 0?0:parseInt(options.interval,10);options.utcOffset=options.utcOffset===void 0?void 0:parseInt(options.utcOffset,10);options.unref=options.unref===void 0?false:options.unref;if(options.startAt){options.startAt=new CronDate(options.startAt,options.timezone)}if(options.stopAt){options.stopAt=new CronDate(options.stopAt,options.timezone)}if(options.interval!==null){if(isNaN(options.interval)){throw new Error("CronOptions: Supplied value for interval is not a number")}else if(options.interval<0){throw new Error("CronOptions: Supplied value for interval can not be negative")}}if(options.utcOffset!==void 0){if(isNaN(options.utcOffset)){throw new Error("CronOptions: Invalid value passed for utcOffset, should be number representing minutes offset from UTC.")}else if(options.utcOffset<-870||options.utcOffset>870){throw new Error("CronOptions: utcOffset out of bounds.")}if(options.utcOffset!==void 0&&options.timezone){throw new Error("CronOptions: Combining 'utcOffset' with 'timezone' is not allowed.")}}if(options.unref!==true&&options.unref!==false){throw new Error("CronOptions: Unref should be either true, false or undefined(false).")}return options}const LAST_OCCURRENCE=32;const ANY_OCCURRENCE=1|2|4|8|16|LAST_OCCURRENCE;const OCCURRENCE_BITMASKS=[1,2,4,16,16];function CronPattern(pattern,timezone){this.pattern=pattern;this.timezone=timezone;this.second=Array(60).fill(0);this.minute=Array(60).fill(0);this.hour=Array(24).fill(0);this.day=Array(31).fill(0);this.month=Array(12).fill(0);this.dayOfWeek=Array(7).fill(0);this.lastDayOfMonth=false;this.starDOM=false;this.starDOW=false;this.parse()}CronPattern.prototype.parse=function(){if(!(typeof this.pattern==="string"||this.pattern.constructor===String)){throw new TypeError("CronPattern: Pattern has to be of type string.")}if(this.pattern.indexOf("@")>=0)this.pattern=this.handleNicknames(this.pattern).trim();const parts=this.pattern.replace(/\s+/g," ").split(" ");if(parts.length<5||parts.length>6){throw new TypeError("CronPattern: invalid configuration format ('"+this.pattern+"'), exactly five or six space separated parts are required.")}if(parts.length===5){parts.unshift("0")}if(parts[3].indexOf("L")>=0){parts[3]=parts[3].replace("L","");this.lastDayOfMonth=true}if(parts[3]=="*"){this.starDOM=true}if(parts[4].length>=3)parts[4]=this.replaceAlphaMonths(parts[4]);if(parts[5].length>=3)parts[5]=this.replaceAlphaDays(parts[5]);if(parts[5]=="*"){this.starDOW=true}if(this.pattern.indexOf("?")>=0){const initDate=new CronDate(new Date,this.timezone).getDate(true);parts[0]=parts[0].replace("?",initDate.getSeconds());parts[1]=parts[1].replace("?",initDate.getMinutes());parts[2]=parts[2].replace("?",initDate.getHours());if(!this.starDOM)parts[3]=parts[3].replace("?",initDate.getDate());parts[4]=parts[4].replace("?",initDate.getMonth()+1);if(!this.starDOW)parts[5]=parts[5].replace("?",initDate.getDay())}this.throwAtIllegalCharacters(parts);this.partToArray("second",parts[0],0,1);this.partToArray("minute",parts[1],0,1);this.partToArray("hour",parts[2],0,1);this.partToArray("day",parts[3],-1,1);this.partToArray("month",parts[4],-1,1);this.partToArray("dayOfWeek",parts[5],0,ANY_OCCURRENCE);if(this.dayOfWeek[7]){this.dayOfWeek[0]=this.dayOfWeek[7]}};CronPattern.prototype.partToArray=function(type,conf,valueIndexOffset,defaultValue){const arr=this[type];const lastDayOfMonth=type==="day"&&this.lastDayOfMonth;if(conf===""&&!lastDayOfMonth)throw new TypeError("CronPattern: configuration entry "+type+" ("+conf+") is empty, check for trailing spaces.");if(conf==="*")return arr.fill(defaultValue);const split=conf.split(",");if(split.length>1){for(let i=0;i6)&&index!=="L"){throw new RangeError("CronPattern: Invalid value for dayOfWeek: "+index)}this.setNthWeekdayOfMonth(index,value);return}if(part==="second"||part==="minute"){if(index<0||index>=60){throw new RangeError("CronPattern: Invalid value for "+part+": "+index)}}else if(part==="hour"){if(index<0||index>=24){throw new RangeError("CronPattern: Invalid value for "+part+": "+index)}}else if(part==="day"){if(index<0||index>=31){throw new RangeError("CronPattern: Invalid value for "+part+": "+index)}}else if(part==="month"){if(index<0||index>=12){throw new RangeError("CronPattern: Invalid value for "+part+": "+index)}}this[part][index]=value};CronPattern.prototype.handleRangeWithStepping=function(conf,type,valueIndexOffset,defaultValue){const result=this.extractNth(conf,type);const matches=result[0].match(/^(\d+)-(\d+)\/(\d+)$/);if(matches===null)throw new TypeError("CronPattern: Syntax error, illegal range with stepping: '"+conf+"'");let[,lower,upper,steps]=matches;lower=parseInt(lower,10)+valueIndexOffset;upper=parseInt(upper,10)+valueIndexOffset;steps=parseInt(steps,10);if(isNaN(lower))throw new TypeError("CronPattern: Syntax error, illegal lower range (NaN)");if(isNaN(upper))throw new TypeError("CronPattern: Syntax error, illegal upper range (NaN)");if(isNaN(steps))throw new TypeError("CronPattern: Syntax error, illegal stepping: (NaN)");if(steps===0)throw new TypeError("CronPattern: Syntax error, illegal stepping: 0");if(steps>this[type].length)throw new TypeError("CronPattern: Syntax error, steps cannot be greater than maximum value of part ("+this[type].length+")");if(lower>upper)throw new TypeError("CronPattern: From value is larger than to value: '"+conf+"'");for(let i=lower;i<=upper;i+=steps){this.setPart(type,i,result[1]||defaultValue)}};CronPattern.prototype.extractNth=function(conf,type){let rest=conf;let nth;if(rest.includes("#")){if(type!=="dayOfWeek"){throw new Error("CronPattern: nth (#) only allowed in day-of-week field")}nth=rest.split("#")[1];rest=rest.split("#")[0]}return[rest,nth]};CronPattern.prototype.handleRange=function(conf,type,valueIndexOffset,defaultValue){const result=this.extractNth(conf,type);const split=result[0].split("-");if(split.length!==2){throw new TypeError("CronPattern: Syntax error, illegal range: '"+conf+"'")}const lower=parseInt(split[0],10)+valueIndexOffset,upper=parseInt(split[1],10)+valueIndexOffset;if(isNaN(lower)){throw new TypeError("CronPattern: Syntax error, illegal lower range (NaN)")}else if(isNaN(upper)){throw new TypeError("CronPattern: Syntax error, illegal upper range (NaN)")}if(lower>upper){throw new TypeError("CronPattern: From value is larger than to value: '"+conf+"'")}for(let i=lower;i<=upper;i++){this.setPart(type,i,result[1]||defaultValue)}};CronPattern.prototype.handleStepping=function(conf,type,valueIndexOffset,defaultValue){const result=this.extractNth(conf,type);const split=result[0].split("/");if(split.length!==2){throw new TypeError("CronPattern: Syntax error, illegal stepping: '"+conf+"'")}let start=0;if(split[0]!=="*"){start=parseInt(split[0],10)+valueIndexOffset}const steps=parseInt(split[1],10);if(isNaN(steps))throw new TypeError("CronPattern: Syntax error, illegal stepping: (NaN)");if(steps===0)throw new TypeError("CronPattern: Syntax error, illegal stepping: 0");if(steps>this[type].length)throw new TypeError("CronPattern: Syntax error, max steps for part is ("+this[type].length+")");for(let i=start;i0){this["dayOfWeek"][index]=this["dayOfWeek"][index]|OCCURRENCE_BITMASKS[nthWeekday-1]}else if(nthWeekday===ANY_OCCURRENCE){this["dayOfWeek"][index]=ANY_OCCURRENCE}else{throw new TypeError(`CronPattern: nth weekday of of range, should be 1-5 or L. Value: ${nthWeekday}`)}};const DaysOfMonth=[31,28,31,30,31,30,31,31,30,31,30,31];const RecursionSteps=[["month","year",0],["day","month",-1],["hour","day",0],["minute","hour",0],["second","minute",0]];function CronDate(d,tz){this.tz=tz;if(d&&d instanceof Date){if(!isNaN(d)){this.fromDate(d)}else{throw new TypeError("CronDate: Invalid date passed to CronDate constructor")}}else if(d===void 0){this.fromDate(new Date)}else if(d&&typeof d==="string"){this.fromString(d)}else if(d instanceof CronDate){this.fromCronDate(d)}else{throw new TypeError("CronDate: Invalid type ("+typeof d+") passed to CronDate constructor")}}CronDate.prototype.isNthWeekdayOfMonth=function(year,month,day,nth){const date=new Date(Date.UTC(year,month,day));const weekday=date.getUTCDay();let count=0;for(let d=1;d<=day;d++){if(new Date(Date.UTC(year,month,d)).getUTCDay()===weekday){count++}}if(nth&ANY_OCCURRENCE&&OCCURRENCE_BITMASKS[count-1]&nth){return true}if(nth&LAST_OCCURRENCE){const daysInMonth=new Date(Date.UTC(year,month+1,0)).getUTCDate();for(let d=day+1;d<=daysInMonth;d++){if(new Date(Date.UTC(year,month,d)).getUTCDay()===weekday){return false}}return true}return false};CronDate.prototype.fromDate=function(inDate){if(this.tz!==void 0){if(typeof this.tz==="number"){this.ms=inDate.getUTCMilliseconds();this.second=inDate.getUTCSeconds();this.minute=inDate.getUTCMinutes()+this.tz;this.hour=inDate.getUTCHours();this.day=inDate.getUTCDate();this.month=inDate.getUTCMonth();this.year=inDate.getUTCFullYear();this.apply()}else{const d=minitz.toTZ(inDate,this.tz);this.ms=inDate.getMilliseconds();this.second=d.s;this.minute=d.i;this.hour=d.h;this.day=d.d;this.month=d.m-1;this.year=d.y}}else{this.ms=inDate.getMilliseconds();this.second=inDate.getSeconds();this.minute=inDate.getMinutes();this.hour=inDate.getHours();this.day=inDate.getDate();this.month=inDate.getMonth();this.year=inDate.getFullYear()}};CronDate.prototype.fromCronDate=function(d){this.tz=d.tz;this.year=d.year;this.month=d.month;this.day=d.day;this.hour=d.hour;this.minute=d.minute;this.second=d.second;this.ms=d.ms};CronDate.prototype.apply=function(){if(this.month>11||this.day>DaysOfMonth[this.month]||this.hour>59||this.minute>59||this.second>59||this.hour<0||this.minute<0||this.second<0){const d=new Date(Date.UTC(this.year,this.month,this.day,this.hour,this.minute,this.second,this.ms));this.ms=d.getUTCMilliseconds();this.second=d.getUTCSeconds();this.minute=d.getUTCMinutes();this.hour=d.getUTCHours();this.day=d.getUTCDate();this.month=d.getUTCMonth();this.year=d.getUTCFullYear();return true}else{return false}};CronDate.prototype.fromString=function(str){if(typeof this.tz==="number"){const inDate=minitz.fromTZISO(str);this.ms=inDate.getUTCMilliseconds();this.second=inDate.getUTCSeconds();this.minute=inDate.getUTCMinutes();this.hour=inDate.getUTCHours();this.day=inDate.getUTCDate();this.month=inDate.getUTCMonth();this.year=inDate.getUTCFullYear();this.apply()}else{return this.fromDate(minitz.fromTZISO(str,this.tz))}};CronDate.prototype.findNext=function(options,target,pattern,offset){const originalTarget=this[target];let lastDayOfMonth;if(pattern.lastDayOfMonth){if(this.month!==1){lastDayOfMonth=DaysOfMonth[this.month]}else{lastDayOfMonth=new Date(Date.UTC(this.year,this.month+1,0,0,0,0,0)).getUTCDate()}}const fDomWeekDay=!pattern.starDOW&&target=="day"?new Date(Date.UTC(this.year,this.month,1,0,0,0,0)).getUTCDay():undefined;for(let i=this[target]+offset;i1){let resetLevel=doing+1;while(resetLevel=RecursionSteps.length){return this}else if(this.year>=3e3){return null}else{return this.recurse(pattern,options,doing)}};CronDate.prototype.increment=function(pattern,options,hasPreviousRun){this.second+=options.interval>1&&hasPreviousRun?options.interval:1;this.ms=0;this.apply();return this.recurse(pattern,options,0)};CronDate.prototype.getDate=function(internal){if(internal||this.tz===void 0){return new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.ms)}else{if(typeof this.tz==="number"){return new Date(Date.UTC(this.year,this.month,this.day,this.hour,this.minute-this.tz,this.second,this.ms))}else{return minitz(this.year,this.month+1,this.day,this.hour,this.minute,this.second,this.tz)}}};CronDate.prototype.getTime=function(){return this.getDate().getTime()};function isFunction(v){return Object.prototype.toString.call(v)==="[object Function]"||"function"===typeof v||v instanceof Function}function unrefTimer(timer){if(typeof Deno!=="undefined"&&typeof Deno.unrefTimer!=="undefined"){Deno.unrefTimer(timer)}else if(timer&&typeof timer.unref!=="undefined"){timer.unref()}}const maxDelay=30*1e3;const scheduledJobs=[];function Cron(pattern,fnOrOptions1,fnOrOptions2){if(!(this instanceof Cron)){return new Cron(pattern,fnOrOptions1,fnOrOptions2)}let options,func;if(isFunction(fnOrOptions1)){func=fnOrOptions1}else if(typeof fnOrOptions1==="object"){options=fnOrOptions1}else if(fnOrOptions1!==void 0){throw new Error("Cron: Invalid argument passed for optionsIn. Should be one of function, or object (options).")}if(isFunction(fnOrOptions2)){func=fnOrOptions2}else if(typeof fnOrOptions2==="object"){options=fnOrOptions2}else if(fnOrOptions2!==void 0){throw new Error("Cron: Invalid argument passed for funcIn. Should be one of function, or object (options).")}this.name=options?options.name:void 0;this.options=CronOptions(options);this._states={kill:false,blocking:false,previousRun:void 0,currentRun:void 0,once:void 0,currentTimeout:void 0,maxRuns:options?options.maxRuns:void 0,paused:options?options.paused:false,pattern:void 0};if(pattern&&(pattern instanceof Date||typeof pattern==="string"&&pattern.indexOf(":")>0)){this._states.once=new CronDate(pattern,this.options.timezone||this.options.utcOffset)}else{this._states.pattern=new CronPattern(pattern,this.options.timezone)}if(this.name){const existing=scheduledJobs.find(j=>j.name===this.name);if(existing){throw new Error("Cron: Tried to initialize new named job '"+this.name+"', but name already taken.")}else{scheduledJobs.push(this)}}if(func!==void 0){this.fn=func;this.schedule()}return this}Cron.prototype.nextRun=function(prev){const next=this._next(prev);return next?next.getDate():null};Cron.prototype.nextRuns=function(n,previous){if(n>this._states.maxRuns){n=this._states.maxRuns}const enumeration=[];let prev=previous||this._states.currentRun;while(n--&&(prev=this.nextRun(prev))){enumeration.push(prev)}return enumeration};Cron.prototype.getPattern=function(){return this._states.pattern?this._states.pattern.pattern:void 0};Cron.prototype.isRunning=function(){const nextRunTime=this.nextRun(this._states.currentRun);const isRunning=!this._states.paused;const isScheduled=this.fn!==void 0;const notIsKilled=!this._states.kill;return isRunning&&isScheduled&¬IsKilled&&nextRunTime!==null};Cron.prototype.isStopped=function(){return this._states.kill};Cron.prototype.isBusy=function(){return this._states.blocking};Cron.prototype.currentRun=function(){return this._states.currentRun?this._states.currentRun.getDate():null};Cron.prototype.previousRun=function(){return this._states.previousRun?this._states.previousRun.getDate():null};Cron.prototype.msToNext=function(prev){prev=prev||new Date;const next=this._next(prev);if(next){return next.getTime()-prev.getTime()}else{return null}};Cron.prototype.stop=function(){this._states.kill=true;if(this._states.currentTimeout){clearTimeout(this._states.currentTimeout)}const jobIndex=scheduledJobs.indexOf(this);if(jobIndex>=0){scheduledJobs.splice(jobIndex,1)}};Cron.prototype.pause=function(){this._states.paused=true;return!this._states.kill};Cron.prototype.resume=function(){this._states.paused=false;return!this._states.kill};Cron.prototype.schedule=function(func){if(func&&this.fn){throw new Error("Cron: It is not allowed to schedule two functions using the same Croner instance.")}else if(func){this.fn=func}let waitMs=this.msToNext();const target=this.nextRun(this._states.currentRun);if(waitMs===null||waitMs===undefined||isNaN(waitMs)||target===null)return this;if(waitMs>maxDelay){waitMs=maxDelay}this._states.currentTimeout=setTimeout(()=>this._checkTrigger(target),waitMs);if(this._states.currentTimeout&&this.options.unref){unrefTimer(this._states.currentTimeout)}return this};Cron.prototype._trigger=async function(initiationDate){this._states.blocking=true;this._states.currentRun=new CronDate(void 0,this.options.timezone||this.options.utcOffset);if(this.options.catch){try{await this.fn(this,this.options.context)}catch(_e){if(isFunction(this.options.catch)){this.options.catch(_e,this)}}}else{await this.fn(this,this.options.context)}this._states.previousRun=new CronDate(initiationDate,this.options.timezone||this.options.utcOffset);this._states.blocking=false};Cron.prototype.trigger=async function(){await this._trigger()};Cron.prototype._checkTrigger=function(target){const now=new Date,shouldRun=!this._states.paused&&now.getTime()>=target,isBlocked=this._states.blocking&&this.options.protect;if(shouldRun&&!isBlocked){this._states.maxRuns--;this._trigger()}else{if(shouldRun&&isBlocked&&isFunction(this.options.protect)){setTimeout(()=>this.options.protect(this),0)}}this.schedule()};Cron.prototype._next=function(prev){const hasPreviousRun=prev||this._states.currentRun?true:false;prev=new CronDate(prev,this.options.timezone||this.options.utcOffset);if(this.options.startAt&&prev&&prev.getTime()=this.options.stopAt.getTime()){return null}else{return nextRun}};Cron.Cron=Cron;Cron.scheduledJobs=scheduledJobs;return Cron}); \ No newline at end of file +(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?module.exports=factory():typeof define==="function"&&define.amd?define(factory):(global=typeof globalThis!=="undefined"?globalThis:global||self,global.Cron=factory())})(this,function(){"use strict";function minitz(y,m,d,h,i,s,tz,throwOnInvalid){return minitz.fromTZ(minitz.tp(y,m,d,h,i,s,tz),throwOnInvalid)}minitz.fromTZISO=(localTimeStr,tz,throwOnInvalid)=>{return minitz.fromTZ(parseISOLocal(localTimeStr,tz),throwOnInvalid)};minitz.fromTZ=function(tp,throwOnInvalid){const inDate=new Date(Date.UTC(tp.y,tp.m-1,tp.d,tp.h,tp.i,tp.s)),offset=getTimezoneOffset(tp.tz,inDate),dateGuess=new Date(inDate.getTime()-offset),dateOffsGuess=getTimezoneOffset(tp.tz,dateGuess);if(dateOffsGuess-offset===0){return dateGuess}else{const dateGuess2=new Date(inDate.getTime()-dateOffsGuess),dateOffsGuess2=getTimezoneOffset(tp.tz,dateGuess2);if(dateOffsGuess2-dateOffsGuess===0){return dateGuess2}else if(!throwOnInvalid&&dateOffsGuess2-dateOffsGuess>0){return dateGuess2}else if(!throwOnInvalid){return dateGuess}else{throw new Error("Invalid date passed to fromTZ()")}}};minitz.toTZ=function(d,tzStr){const localDateString=d.toLocaleString("en-US",{timeZone:tzStr}).replace(/[\u202f]/," ");const td=new Date(localDateString);return{y:td.getFullYear(),m:td.getMonth()+1,d:td.getDate(),h:td.getHours(),i:td.getMinutes(),s:td.getSeconds(),tz:tzStr}};minitz.tp=(y,m,d,h,i,s,tz)=>{return{y:y,m:m,d:d,h:h,i:i,s:s,tz:tz}};function getTimezoneOffset(timeZone,date=new Date){const tz=date.toLocaleString("en-US",{timeZone:timeZone,timeZoneName:"shortOffset"}).split(" ").slice(-1)[0];const dateString=date.toLocaleString("en-US").replace(/[\u202f]/," ");return Date.parse(`${dateString} GMT`)-Date.parse(`${dateString} ${tz}`)}function parseISOLocal(dtStr,tz){const pd=new Date(Date.parse(dtStr));if(isNaN(pd)){throw new Error("minitz: Invalid ISO8601 passed to parser.")}const stringEnd=dtStr.substring(9);if(dtStr.includes("Z")||stringEnd.includes("-")||stringEnd.includes("+")){return minitz.tp(pd.getUTCFullYear(),pd.getUTCMonth()+1,pd.getUTCDate(),pd.getUTCHours(),pd.getUTCMinutes(),pd.getUTCSeconds(),"Etc/UTC")}else{return minitz.tp(pd.getFullYear(),pd.getMonth()+1,pd.getDate(),pd.getHours(),pd.getMinutes(),pd.getSeconds(),tz)}}minitz.minitz=minitz;function CronOptions(options){if(options===void 0){options={}}delete options.name;options.legacyMode=options.legacyMode===void 0?true:options.legacyMode;options.paused=options.paused===void 0?false:options.paused;options.maxRuns=options.maxRuns===void 0?Infinity:options.maxRuns;options.catch=options.catch===void 0?false:options.catch;options.interval=options.interval===void 0?0:parseInt(options.interval,10);options.utcOffset=options.utcOffset===void 0?void 0:parseInt(options.utcOffset,10);options.unref=options.unref===void 0?false:options.unref;if(options.startAt){options.startAt=new CronDate(options.startAt,options.timezone)}if(options.stopAt){options.stopAt=new CronDate(options.stopAt,options.timezone)}if(options.interval!==null){if(isNaN(options.interval)){throw new Error("CronOptions: Supplied value for interval is not a number")}else if(options.interval<0){throw new Error("CronOptions: Supplied value for interval can not be negative")}}if(options.utcOffset!==void 0){if(isNaN(options.utcOffset)){throw new Error("CronOptions: Invalid value passed for utcOffset, should be number representing minutes offset from UTC.")}else if(options.utcOffset<-870||options.utcOffset>870){throw new Error("CronOptions: utcOffset out of bounds.")}if(options.utcOffset!==void 0&&options.timezone){throw new Error("CronOptions: Combining 'utcOffset' with 'timezone' is not allowed.")}}if(options.unref!==true&&options.unref!==false){throw new Error("CronOptions: Unref should be either true, false or undefined(false).")}return options}const LAST_OCCURRENCE=32;const ANY_OCCURRENCE=1|2|4|8|16|LAST_OCCURRENCE;const OCCURRENCE_BITMASKS=[1,2,4,16,16];function CronPattern(pattern,timezone){this.pattern=pattern;this.timezone=timezone;this.second=Array(60).fill(0);this.minute=Array(60).fill(0);this.hour=Array(24).fill(0);this.day=Array(31).fill(0);this.month=Array(12).fill(0);this.dayOfWeek=Array(7).fill(0);this.lastDayOfMonth=false;this.starDOM=false;this.starDOW=false;this.parse()}CronPattern.prototype.parse=function(){if(!(typeof this.pattern==="string"||this.pattern.constructor===String)){throw new TypeError("CronPattern: Pattern has to be of type string.")}if(this.pattern.indexOf("@")>=0)this.pattern=this.handleNicknames(this.pattern).trim();const parts=this.pattern.replace(/\s+/g," ").split(" ");if(parts.length<5||parts.length>6){throw new TypeError("CronPattern: invalid configuration format ('"+this.pattern+"'), exactly five or six space separated parts are required.")}if(parts.length===5){parts.unshift("0")}if(parts[3].indexOf("L")>=0){parts[3]=parts[3].replace("L","");this.lastDayOfMonth=true}if(parts[3]=="*"){this.starDOM=true}if(parts[4].length>=3)parts[4]=this.replaceAlphaMonths(parts[4]);if(parts[5].length>=3)parts[5]=this.replaceAlphaDays(parts[5]);if(parts[5]=="*"){this.starDOW=true}if(this.pattern.indexOf("?")>=0){const initDate=new CronDate(new Date,this.timezone).getDate(true);parts[0]=parts[0].replace("?",initDate.getSeconds());parts[1]=parts[1].replace("?",initDate.getMinutes());parts[2]=parts[2].replace("?",initDate.getHours());if(!this.starDOM)parts[3]=parts[3].replace("?",initDate.getDate());parts[4]=parts[4].replace("?",initDate.getMonth()+1);if(!this.starDOW)parts[5]=parts[5].replace("?",initDate.getDay())}this.throwAtIllegalCharacters(parts);this.partToArray("second",parts[0],0,1);this.partToArray("minute",parts[1],0,1);this.partToArray("hour",parts[2],0,1);this.partToArray("day",parts[3],-1,1);this.partToArray("month",parts[4],-1,1);this.partToArray("dayOfWeek",parts[5],0,ANY_OCCURRENCE);if(this.dayOfWeek[7]){this.dayOfWeek[0]=this.dayOfWeek[7]}};CronPattern.prototype.partToArray=function(type,conf,valueIndexOffset,defaultValue){const arr=this[type];const lastDayOfMonth=type==="day"&&this.lastDayOfMonth;if(conf===""&&!lastDayOfMonth)throw new TypeError("CronPattern: configuration entry "+type+" ("+conf+") is empty, check for trailing spaces.");if(conf==="*")return arr.fill(defaultValue);const split=conf.split(",");if(split.length>1){for(let i=0;i6)&&index!=="L"){throw new RangeError("CronPattern: Invalid value for dayOfWeek: "+index)}this.setNthWeekdayOfMonth(index,value);return}if(part==="second"||part==="minute"){if(index<0||index>=60){throw new RangeError("CronPattern: Invalid value for "+part+": "+index)}}else if(part==="hour"){if(index<0||index>=24){throw new RangeError("CronPattern: Invalid value for "+part+": "+index)}}else if(part==="day"){if(index<0||index>=31){throw new RangeError("CronPattern: Invalid value for "+part+": "+index)}}else if(part==="month"){if(index<0||index>=12){throw new RangeError("CronPattern: Invalid value for "+part+": "+index)}}this[part][index]=value};CronPattern.prototype.handleRangeWithStepping=function(conf,type,valueIndexOffset,defaultValue){const result=this.extractNth(conf,type);const matches=result[0].match(/^(\d+)-(\d+)\/(\d+)$/);if(matches===null)throw new TypeError("CronPattern: Syntax error, illegal range with stepping: '"+conf+"'");let[,lower,upper,steps]=matches;lower=parseInt(lower,10)+valueIndexOffset;upper=parseInt(upper,10)+valueIndexOffset;steps=parseInt(steps,10);if(isNaN(lower))throw new TypeError("CronPattern: Syntax error, illegal lower range (NaN)");if(isNaN(upper))throw new TypeError("CronPattern: Syntax error, illegal upper range (NaN)");if(isNaN(steps))throw new TypeError("CronPattern: Syntax error, illegal stepping: (NaN)");if(steps===0)throw new TypeError("CronPattern: Syntax error, illegal stepping: 0");if(steps>this[type].length)throw new TypeError("CronPattern: Syntax error, steps cannot be greater than maximum value of part ("+this[type].length+")");if(lower>upper)throw new TypeError("CronPattern: From value is larger than to value: '"+conf+"'");for(let i=lower;i<=upper;i+=steps){this.setPart(type,i,result[1]||defaultValue)}};CronPattern.prototype.extractNth=function(conf,type){let rest=conf;let nth;if(rest.includes("#")){if(type!=="dayOfWeek"){throw new Error("CronPattern: nth (#) only allowed in day-of-week field")}nth=rest.split("#")[1];rest=rest.split("#")[0]}return[rest,nth]};CronPattern.prototype.handleRange=function(conf,type,valueIndexOffset,defaultValue){const result=this.extractNth(conf,type);const split=result[0].split("-");if(split.length!==2){throw new TypeError("CronPattern: Syntax error, illegal range: '"+conf+"'")}const lower=parseInt(split[0],10)+valueIndexOffset,upper=parseInt(split[1],10)+valueIndexOffset;if(isNaN(lower)){throw new TypeError("CronPattern: Syntax error, illegal lower range (NaN)")}else if(isNaN(upper)){throw new TypeError("CronPattern: Syntax error, illegal upper range (NaN)")}if(lower>upper){throw new TypeError("CronPattern: From value is larger than to value: '"+conf+"'")}for(let i=lower;i<=upper;i++){this.setPart(type,i,result[1]||defaultValue)}};CronPattern.prototype.handleStepping=function(conf,type,valueIndexOffset,defaultValue){const result=this.extractNth(conf,type);const split=result[0].split("/");if(split.length!==2){throw new TypeError("CronPattern: Syntax error, illegal stepping: '"+conf+"'")}let start=0;if(split[0]!=="*"){start=parseInt(split[0],10)+valueIndexOffset}const steps=parseInt(split[1],10);if(isNaN(steps))throw new TypeError("CronPattern: Syntax error, illegal stepping: (NaN)");if(steps===0)throw new TypeError("CronPattern: Syntax error, illegal stepping: 0");if(steps>this[type].length)throw new TypeError("CronPattern: Syntax error, max steps for part is ("+this[type].length+")");for(let i=start;i0){this["dayOfWeek"][index]=this["dayOfWeek"][index]|OCCURRENCE_BITMASKS[nthWeekday-1]}else if(nthWeekday===ANY_OCCURRENCE){this["dayOfWeek"][index]=ANY_OCCURRENCE}else{throw new TypeError(`CronPattern: nth weekday of of range, should be 1-5 or L. Value: ${nthWeekday}`)}};const DaysOfMonth=[31,28,31,30,31,30,31,31,30,31,30,31];const RecursionSteps=[["month","year",0],["day","month",-1],["hour","day",0],["minute","hour",0],["second","minute",0]];function CronDate(d,tz){this.tz=tz;if(d&&d instanceof Date){if(!isNaN(d)){this.fromDate(d)}else{throw new TypeError("CronDate: Invalid date passed to CronDate constructor")}}else if(d===void 0){this.fromDate(new Date)}else if(d&&typeof d==="string"){this.fromString(d)}else if(d instanceof CronDate){this.fromCronDate(d)}else{throw new TypeError("CronDate: Invalid type ("+typeof d+") passed to CronDate constructor")}}CronDate.prototype.isNthWeekdayOfMonth=function(year,month,day,nth){const date=new Date(Date.UTC(year,month,day));const weekday=date.getUTCDay();let count=0;for(let d=1;d<=day;d++){if(new Date(Date.UTC(year,month,d)).getUTCDay()===weekday){count++}}if(nth&ANY_OCCURRENCE&&OCCURRENCE_BITMASKS[count-1]&nth){return true}if(nth&LAST_OCCURRENCE){const daysInMonth=new Date(Date.UTC(year,month+1,0)).getUTCDate();for(let d=day+1;d<=daysInMonth;d++){if(new Date(Date.UTC(year,month,d)).getUTCDay()===weekday){return false}}return true}return false};CronDate.prototype.fromDate=function(inDate){if(this.tz!==void 0){if(typeof this.tz==="number"){this.ms=inDate.getUTCMilliseconds();this.second=inDate.getUTCSeconds();this.minute=inDate.getUTCMinutes()+this.tz;this.hour=inDate.getUTCHours();this.day=inDate.getUTCDate();this.month=inDate.getUTCMonth();this.year=inDate.getUTCFullYear();this.apply()}else{const d=minitz.toTZ(inDate,this.tz);this.ms=inDate.getMilliseconds();this.second=d.s;this.minute=d.i;this.hour=d.h;this.day=d.d;this.month=d.m-1;this.year=d.y}}else{this.ms=inDate.getMilliseconds();this.second=inDate.getSeconds();this.minute=inDate.getMinutes();this.hour=inDate.getHours();this.day=inDate.getDate();this.month=inDate.getMonth();this.year=inDate.getFullYear()}};CronDate.prototype.fromCronDate=function(d){this.tz=d.tz;this.year=d.year;this.month=d.month;this.day=d.day;this.hour=d.hour;this.minute=d.minute;this.second=d.second;this.ms=d.ms};CronDate.prototype.apply=function(){if(this.month>11||this.day>DaysOfMonth[this.month]||this.hour>59||this.minute>59||this.second>59||this.hour<0||this.minute<0||this.second<0){const d=new Date(Date.UTC(this.year,this.month,this.day,this.hour,this.minute,this.second,this.ms));this.ms=d.getUTCMilliseconds();this.second=d.getUTCSeconds();this.minute=d.getUTCMinutes();this.hour=d.getUTCHours();this.day=d.getUTCDate();this.month=d.getUTCMonth();this.year=d.getUTCFullYear();return true}else{return false}};CronDate.prototype.fromString=function(str){if(typeof this.tz==="number"){const inDate=minitz.fromTZISO(str);this.ms=inDate.getUTCMilliseconds();this.second=inDate.getUTCSeconds();this.minute=inDate.getUTCMinutes();this.hour=inDate.getUTCHours();this.day=inDate.getUTCDate();this.month=inDate.getUTCMonth();this.year=inDate.getUTCFullYear();this.apply()}else{return this.fromDate(minitz.fromTZISO(str,this.tz))}};CronDate.prototype.findNext=function(options,target,pattern,offset){const originalTarget=this[target];let lastDayOfMonth;if(pattern.lastDayOfMonth){if(this.month!==1){lastDayOfMonth=DaysOfMonth[this.month]}else{lastDayOfMonth=new Date(Date.UTC(this.year,this.month+1,0,0,0,0,0)).getUTCDate()}}const fDomWeekDay=!pattern.starDOW&&target=="day"?new Date(Date.UTC(this.year,this.month,1,0,0,0,0)).getUTCDay():undefined;for(let i=this[target]+offset;i1){let resetLevel=doing+1;while(resetLevel=RecursionSteps.length){return this}else if(this.year>=3e3){return null}else{return this.recurse(pattern,options,doing)}};CronDate.prototype.increment=function(pattern,options,hasPreviousRun){this.second+=options.interval>1&&hasPreviousRun?options.interval:1;this.ms=0;this.apply();return this.recurse(pattern,options,0)};CronDate.prototype.getDate=function(internal){if(internal||this.tz===void 0){return new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.ms)}else{if(typeof this.tz==="number"){return new Date(Date.UTC(this.year,this.month,this.day,this.hour,this.minute-this.tz,this.second,this.ms))}else{return minitz(this.year,this.month+1,this.day,this.hour,this.minute,this.second,this.tz)}}};CronDate.prototype.getTime=function(){return this.getDate().getTime()};function isFunction(v){return Object.prototype.toString.call(v)==="[object Function]"||"function"===typeof v||v instanceof Function}function unrefTimer(timer){if(typeof Deno!=="undefined"&&typeof Deno.unrefTimer!=="undefined"){Deno.unrefTimer(timer)}else if(timer&&typeof timer.unref!=="undefined"){timer.unref()}}const maxDelay=30*1e3;const scheduledJobs=[];function Cron(pattern,fnOrOptions1,fnOrOptions2){if(!(this instanceof Cron)){return new Cron(pattern,fnOrOptions1,fnOrOptions2)}let options,func;if(isFunction(fnOrOptions1)){func=fnOrOptions1}else if(typeof fnOrOptions1==="object"){options=fnOrOptions1}else if(fnOrOptions1!==void 0){throw new Error("Cron: Invalid argument passed for optionsIn. Should be one of function, or object (options).")}if(isFunction(fnOrOptions2)){func=fnOrOptions2}else if(typeof fnOrOptions2==="object"){options=fnOrOptions2}else if(fnOrOptions2!==void 0){throw new Error("Cron: Invalid argument passed for funcIn. Should be one of function, or object (options).")}this.name=options?options.name:void 0;this.options=CronOptions(options);this._states={kill:false,blocking:false,previousRun:void 0,currentRun:void 0,once:void 0,currentTimeout:void 0,maxRuns:options?options.maxRuns:void 0,paused:options?options.paused:false,pattern:void 0};if(pattern&&(pattern instanceof Date||typeof pattern==="string"&&pattern.indexOf(":")>0)){this._states.once=new CronDate(pattern,this.options.timezone||this.options.utcOffset)}else{this._states.pattern=new CronPattern(pattern,this.options.timezone)}if(this.name){const existing=scheduledJobs.find(j=>j.name===this.name);if(existing){throw new Error("Cron: Tried to initialize new named job '"+this.name+"', but name already taken.")}else{scheduledJobs.push(this)}}if(func!==void 0){this.fn=func;this.schedule()}return this}Cron.prototype.nextRun=function(prev){const next=this._next(prev);return next?next.getDate():null};Cron.prototype.nextRuns=function(n,previous){if(n>this._states.maxRuns){n=this._states.maxRuns}const enumeration=[];let prev=previous||this._states.currentRun;while(n--&&(prev=this.nextRun(prev))){enumeration.push(prev)}return enumeration};Cron.prototype.getPattern=function(){return this._states.pattern?this._states.pattern.pattern:void 0};Cron.prototype.isRunning=function(){const nextRunTime=this.nextRun(this._states.currentRun);const isRunning=!this._states.paused;const isScheduled=this.fn!==void 0;const notIsKilled=!this._states.kill;return isRunning&&isScheduled&¬IsKilled&&nextRunTime!==null};Cron.prototype.isStopped=function(){return this._states.kill};Cron.prototype.isBusy=function(){return this._states.blocking};Cron.prototype.currentRun=function(){return this._states.currentRun?this._states.currentRun.getDate():null};Cron.prototype.previousRun=function(){return this._states.previousRun?this._states.previousRun.getDate():null};Cron.prototype.msToNext=function(prev){prev=prev||new Date;const next=this._next(prev);if(next){return next.getTime()-prev.getTime()}else{return null}};Cron.prototype.stop=function(){this._states.kill=true;if(this._states.currentTimeout){clearTimeout(this._states.currentTimeout)}const jobIndex=scheduledJobs.indexOf(this);if(jobIndex>=0){scheduledJobs.splice(jobIndex,1)}};Cron.prototype.pause=function(){this._states.paused=true;return!this._states.kill};Cron.prototype.resume=function(){this._states.paused=false;return!this._states.kill};Cron.prototype.schedule=function(func){if(func&&this.fn){throw new Error("Cron: It is not allowed to schedule two functions using the same Croner instance.")}else if(func){this.fn=func}let waitMs=this.msToNext();const target=this.nextRun(this._states.currentRun);if(waitMs===null||waitMs===undefined||isNaN(waitMs)||target===null)return this;if(waitMs>maxDelay){waitMs=maxDelay}this._states.currentTimeout=setTimeout(()=>this._checkTrigger(target),waitMs);if(this._states.currentTimeout&&this.options.unref){unrefTimer(this._states.currentTimeout)}return this};Cron.prototype._trigger=async function(initiationDate){this._states.blocking=true;this._states.currentRun=new CronDate(void 0,this.options.timezone||this.options.utcOffset);if(this.options.catch){try{await this.fn(this,this.options.context)}catch(_e){if(isFunction(this.options.catch)){this.options.catch(_e,this)}}}else{await this.fn(this,this.options.context)}this._states.previousRun=new CronDate(initiationDate,this.options.timezone||this.options.utcOffset);this._states.blocking=false};Cron.prototype.trigger=async function(){await this._trigger()};Cron.prototype._checkTrigger=function(target){const now=new Date,shouldRun=!this._states.paused&&now.getTime()>=target,isBlocked=this._states.blocking&&this.options.protect;if(shouldRun&&!isBlocked){this._states.maxRuns--;this._trigger()}else{if(shouldRun&&isBlocked&&isFunction(this.options.protect)){setTimeout(()=>this.options.protect(this),0)}}this.schedule()};Cron.prototype._next=function(prev){let hasPreviousRun=prev||this._states.currentRun?true:false;if(!prev&&this.options.startAt&&this.options.interval){prev=this.options.startAt;const now=new CronDate(undefined,this.options.timezone||this.options.utcOffset);let prevTimePlusInterval=prev.getTime()+this.options.interval*1e3;while(prevTimePlusInterval<=now.getTime()){prev=new CronDate(prev,this.options.timezone||this.options.utcOffset).increment(this._states.pattern,this.options,true);prevTimePlusInterval=prev.getTime()+this.options.interval*1e3}hasPreviousRun=true}prev=new CronDate(prev,this.options.timezone||this.options.utcOffset);if(this.options.startAt&&prev&&prev.getTime()=this.options.stopAt.getTime()){return null}else{return nextRun}};Cron.Cron=Cron;Cron.scheduledJobs=scheduledJobs;return Cron}); \ No newline at end of file diff --git a/dist/croner.umd.min.js.map b/dist/croner.umd.min.js.map index ae8ed6d..1ee050a 100644 --- a/dist/croner.umd.min.js.map +++ b/dist/croner.umd.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["dist/croner.umd.js"],"names":["global","factory","exports","module","define","amd","globalThis","self","Cron","this","minitz","y","m","d","h","i","s","tz","throwOnInvalid","fromTZ","tp","fromTZISO","localTimeStr","parseISOLocal","inDate","Date","UTC","offset","getTimezoneOffset","dateGuess","getTime","dateOffsGuess","dateGuess2","dateOffsGuess2","Error","toTZ","tzStr","localDateString","toLocaleString","timeZone","replace","td","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","date","timeZoneName","split","slice","dateString","parse","dtStr","pd","isNaN","stringEnd","substring","includes","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","CronOptions","options","name","legacyMode","paused","maxRuns","Infinity","catch","interval","parseInt","utcOffset","unref","startAt","CronDate","timezone","stopAt","LAST_OCCURRENCE","ANY_OCCURRENCE","OCCURRENCE_BITMASKS","CronPattern","pattern","second","Array","fill","minute","hour","day","month","dayOfWeek","lastDayOfMonth","starDOM","starDOW","prototype","constructor","String","TypeError","indexOf","handleNicknames","trim","parts","length","unshift","replaceAlphaMonths","replaceAlphaDays","initDate","getDay","throwAtIllegalCharacters","partToArray","type","conf","valueIndexOffset","defaultValue","arr","let","handleRangeWithStepping","handleRange","handleStepping","handleNumber","reValidCron","test","result","extractNth","setPart","part","index","value","Object","hasOwnProperty","call","RangeError","setNthWeekdayOfMonth","matches","match","lower","upper","steps","rest","nth","start","cleanPattern","toLowerCase","nthWeekday","DaysOfMonth","RecursionSteps","fromDate","fromString","fromCronDate","isNthWeekdayOfMonth","year","weekday","getUTCDay","count","daysInMonth","ms","getUTCMilliseconds","apply","getMilliseconds","str","findNext","target","originalTarget","fDomWeekDay","undefined","dowMatch","recurse","doing","res","resetLevel","increment","hasPreviousRun","internal","isFunction","v","toString","Function","unrefTimer","timer","Deno","maxDelay","scheduledJobs","fnOrOptions1","fnOrOptions2","func","_states","kill","blocking","previousRun","currentRun","once","currentTimeout","existing","find","j","push","fn","schedule","nextRun","prev","next","_next","nextRuns","n","previous","enumeration","getPattern","isRunning","nextRunTime","isScheduled","notIsKilled","isStopped","isBusy","msToNext","stop","clearTimeout","jobIndex","splice","pause","resume","waitMs","setTimeout","_checkTrigger","_trigger","async","initiationDate","await","context","_e","trigger","now","shouldRun","isBlocked","protect"],"mappings":"CAAA,SAAWA,OAAQC,SAClB,OAAOC,UAAY,UAAY,OAAOC,SAAW,YAAcA,OAAOD,QAAUD,QAAQ,EACxF,OAAOG,SAAW,YAAcA,OAAOC,IAAMD,OAAOH,OAAO,GAC1DD,OAAS,OAAOM,aAAe,YAAcA,WAAaN,QAAUO,KAAMP,OAAOQ,KAAOP,QAAQ,EACjG,GAAEQ,KAAM,WAAe,aA+DtB,SAASC,OAAOC,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,GAAIC,gBACtC,OAAOR,OAAOS,OAAOT,OAAOU,GAAGT,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,EAAE,EAAGC,cAAc,CACrE,CAgBAR,OAAOW,UAAY,CAACC,aAAcL,GAAIC,kBACrC,OAAOR,OAAOS,OAAOI,cAAcD,aAAcL,EAAE,EAAGC,cAAc,CACrE,EAcAR,OAAOS,OAAS,SAASC,GAAIF,gBAE5B,MAGCM,OAAS,IAAIC,KAAKA,KAAKC,IACtBN,GAAGT,EACHS,GAAGR,EAAI,EACPQ,GAAGP,EACHO,GAAGN,EACHM,GAAGL,EACHK,GAAGJ,CACJ,CAAC,EAGDW,OAASC,kBAAkBR,GAAGH,GAAIO,MAAM,EAGxCK,UAAY,IAAIJ,KAAKD,OAAOM,QAAQ,EAAIH,MAAM,EAG9CI,cAAgBH,kBAAkBR,GAAGH,GAAIY,SAAS,EAInD,GAAKE,cAAgBJ,SAAY,EAAG,CACnC,OAAOE,SACR,KAAO,CAIN,MACCG,WAAa,IAAIP,KAAKD,OAAOM,QAAQ,EAAIC,aAAa,EACtDE,eAAiBL,kBAAkBR,GAAGH,GAAIe,UAAU,EACrD,GAAKC,eAAiBF,gBAAmB,EAAG,CAE3C,OAAOC,UACR,MAAO,GAAG,CAACd,gBAAmBe,eAAiBF,cAAiB,EAAG,CAElE,OAAOC,UACR,MA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lM,KAAK0D,QAAQa,UAAYvE,KAAK0D,QAAQS,SAAS,EAAEkG,UACnErK,KAAKoL,QAAQvG,QACb7E,KAAK0D,QACL4G,cACD,EAED,GAAItK,KAAKoL,QAAQK,MAAQzL,KAAKoL,QAAQK,KAAKpK,QAAQ,GAAK6K,KAAK7K,QAAQ,EAAG,CACvE,OAAO,IACR,MAAO,GACL4K,UAAY,MACZjM,KAAKoL,QAAQtH,SAAW,GACxB9D,KAAKoL,QAAY,MACjBpL,KAAK0D,QAAQc,QAAUyH,QAAQ5K,QAAQ,GAAKrB,KAAK0D,QAAQc,OAAOnD,QAAQ,EACxE,CACD,OAAO,IACR,KAAO,CAEN,OAAO4K,OACR,CACD,EAEAlM,KAAKA,KAAOA,KACZA,KAAKiL,cAAgBA,cAErB,OAAOjL,IAEP,CAAC"} \ No newline at end of file +{"version":3,"sources":["dist/croner.umd.js"],"names":["global","factory","exports","module","define","amd","globalThis","self","Cron","this","minitz","y","m","d","h","i","s","tz","throwOnInvalid","fromTZ","tp","fromTZISO","localTimeStr","parseISOLocal","inDate","Date","UTC","offset","getTimezoneOffset","dateGuess","getTime","dateOffsGuess","dateGuess2","dateOffsGuess2","Error","toTZ","tzStr","localDateString","toLocaleString","timeZone","replace","td","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","date","timeZoneName","split","slice","dateString","parse","dtStr","pd","isNaN","stringEnd","substring","includes","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","CronOptions","options","name","legacyMode","paused","maxRuns","Infinity","catch","interval","parseInt","utcOffset","unref","startAt","CronDate","timezone","stopAt","LAST_OCCURRENCE","ANY_OCCURRENCE","OCCURRENCE_BITMASKS","CronPattern","pattern","second","Array","fill","minute","hour","day","month","dayOfWeek","lastDayOfMonth","starDOM","starDOW","prototype","constructor","String","TypeError","indexOf","handleNicknames","trim","parts","length","unshift","replaceAlphaMonths","replaceAlphaDays","initDate","getDay","throwAtIllegalCharacters","partToArray","type","conf","valueIndexOffset","defaultValue","arr","let","handleRangeWithStepping","handleRange","handleStepping","handleNumber","reValidCron","test","result","extractNth","setPart","part","index","value","Object","hasOwnProperty","call","RangeError","setNthWeekdayOfMonth","matches","match","lower","upper","steps","rest","nth","start","cleanPattern","toLowerCase","nthWeekday","DaysOfMonth","RecursionSteps","fromDate","fromString","fromCronDate","isNthWeekdayOfMonth","year","weekday","getUTCDay","count","daysInMonth","ms","getUTCMilliseconds","apply","getMilliseconds","str","findNext","target","originalTarget","fDomWeekDay","undefined","dowMatch","recurse","doing","res","resetLevel","increment","hasPreviousRun","internal","isFunction","v","toString","Function","unrefTimer","timer","Deno","maxDelay","scheduledJobs","fnOrOptions1","fnOrOptions2","func","_states","kill","blocking","previousRun","currentRun","once","currentTimeout","existing","find","j","push","fn","schedule","nextRun","prev","next","_next","nextRuns","n","previous","enumeration","getPattern","isRunning","nextRunTime","isScheduled","notIsKilled","isStopped","isBusy","msToNext","stop","clearTimeout","jobIndex","splice","pause","resume","waitMs","setTimeout","_checkTrigger","_trigger","async","initiationDate","await","context","_e","trigger","now","shouldRun","isBlocked","protect","prevTimePlusInterval"],"mappings":"CAAA,SAAWA,OAAQC,SAClB,OAAOC,UAAY,UAAY,OAAOC,SAAW,YAAcA,OAAOD,QAAUD,QAAQ,EACxF,OAAOG,SAAW,YAAcA,OAAOC,IAAMD,OAAOH,OAAO,GAC1DD,OAAS,OAAOM,aAAe,YAAcA,WAAaN,QAAUO,KAAMP,OAAOQ,KAAOP,QAAQ,EACjG,GAAEQ,KAAM,WAAe,aA+DtB,SAASC,OAAOC,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,GAAIC,gBACtC,OAAOR,OAAOS,OAAOT,OAAOU,GAAGT,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,EAAE,EAAGC,cAAc,CACrE,CAgBAR,OAAOW,UAAY,CAACC,aAAcL,GAAIC,kBACrC,OAAOR,OAAOS,OAAOI,cAAcD,aAAcL,EAA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0D,QAAQS,SAAS,EAAEkG,UACnErK,KAAKoL,QAAQvG,QACb7E,KAAK0D,QACL4G,cACD,EAED,GAAItK,KAAKoL,QAAQK,MAAQzL,KAAKoL,QAAQK,KAAKpK,QAAQ,GAAK6K,KAAK7K,QAAQ,EAAG,CACvE,OAAO,IACR,MAAO,GACL4K,UAAY,MACZjM,KAAKoL,QAAQtH,SAAW,GACxB9D,KAAKoL,QAAY,MACjBpL,KAAK0D,QAAQc,QAAUyH,QAAQ5K,QAAQ,GAAKrB,KAAK0D,QAAQc,OAAOnD,QAAQ,EACxE,CACD,OAAO,IACR,KAAO,CAEN,OAAO4K,OACR,CACD,EAEAlM,KAAKA,KAAOA,KACZA,KAAKiL,cAAgBA,cAErB,OAAOjL,IAEP,CAAC"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 8414199..5e7eb9e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,15 +20,6 @@ "node": ">=18.0" } }, - "node_modules/@aashutoshrathi/word-wrap": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", - "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -154,9 +145,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.14.1.tgz", - "integrity": "sha512-fH8/o8nSUek8ceQnT7K4EQbSiV7jgkHq81m9lWZFIXjJ7lJzpWXbQFpT/Zh6OZYnpFykvzC3fbEvEAFZu03dPA==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.17.2.tgz", + "integrity": "sha512-NM0jFxY8bB8QLkoKxIQeObCaDlJKewVlIEkuyYKm5An1tdVZ966w2+MPQ2l8LBZLjR+SgyV+nRkTIunzOYBMLQ==", "cpu": [ "arm" ], @@ -167,9 +158,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.14.1.tgz", - "integrity": "sha512-Y/9OHLjzkunF+KGEoJr3heiD5X9OLa8sbT1lm0NYeKyaM3oMhhQFvPB0bNZYJwlq93j8Z6wSxh9+cyKQaxS7PQ==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.17.2.tgz", + "integrity": "sha512-yeX/Usk7daNIVwkq2uGoq2BYJKZY1JfyLTaHO/jaiSwi/lsf8fTFoQW/n6IdAsx5tx+iotu2zCJwz8MxI6D/Bw==", "cpu": [ "arm64" ], @@ -180,9 +171,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.14.1.tgz", - "integrity": "sha512-+kecg3FY84WadgcuSVm6llrABOdQAEbNdnpi5X3UwWiFVhZIZvKgGrF7kmLguvxHNQy+UuRV66cLVl3S+Rkt+Q==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.17.2.tgz", + "integrity": "sha512-kcMLpE6uCwls023+kknm71ug7MZOrtXo+y5p/tsg6jltpDtgQY1Eq5sGfHcQfb+lfuKwhBmEURDga9N0ol4YPw==", "cpu": [ "arm64" ], @@ -193,9 +184,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.14.1.tgz", - "integrity": "sha512-2pYRzEjVqq2TB/UNv47BV/8vQiXkFGVmPFwJb+1E0IFFZbIX8/jo1olxqqMbo6xCXf8kabANhp5bzCij2tFLUA==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.17.2.tgz", + "integrity": "sha512-AtKwD0VEx0zWkL0ZjixEkp5tbNLzX+FCqGG1SvOu993HnSz4qDI6S4kGzubrEJAljpVkhRSlg5bzpV//E6ysTQ==", "cpu": [ "x64" ], @@ -206,9 +197,22 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.14.1.tgz", - "integrity": "sha512-mS6wQ6Do6/wmrF9aTFVpIJ3/IDXhg1EZcQFYHZLHqw6AzMBjTHWnCG35HxSqUNphh0EHqSM6wRTT8HsL1C0x5g==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.17.2.tgz", + "integrity": "sha512-3reX2fUHqN7sffBNqmEyMQVj/CKhIHZd4y631duy0hZqI8Qoqf6lTtmAKvJFYa6bhU95B1D0WgzHkmTg33In0A==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.17.2.tgz", + "integrity": "sha512-uSqpsp91mheRgw96xtyAGP9FW5ChctTFEoXP0r5FAzj/3ZRv3Uxjtc7taRQSaQM/q85KEKjKsZuiZM3GyUivRg==", "cpu": [ "arm" ], @@ -219,9 +223,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.14.1.tgz", - "integrity": "sha512-p9rGKYkHdFMzhckOTFubfxgyIO1vw//7IIjBBRVzyZebWlzRLeNhqxuSaZ7kCEKVkm/kuC9fVRW9HkC/zNRG2w==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.17.2.tgz", + "integrity": "sha512-EMMPHkiCRtE8Wdk3Qhtciq6BndLtstqZIroHiiGzB3C5LDJmIZcSzVtLRbwuXuUft1Cnv+9fxuDtDxz3k3EW2A==", "cpu": [ "arm64" ], @@ -232,9 +236,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.14.1.tgz", - "integrity": "sha512-nDY6Yz5xS/Y4M2i9JLQd3Rofh5OR8Bn8qe3Mv/qCVpHFlwtZSBYSPaU4mrGazWkXrdQ98GB//H0BirGR/SKFSw==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.17.2.tgz", + "integrity": "sha512-NMPylUUZ1i0z/xJUIx6VUhISZDRT+uTWpBcjdv0/zkp7b/bQDF+NfnfdzuTiB1G6HTodgoFa93hp0O1xl+/UbA==", "cpu": [ "arm64" ], @@ -245,11 +249,11 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.14.1.tgz", - "integrity": "sha512-im7HE4VBL+aDswvcmfx88Mp1soqL9OBsdDBU8NqDEYtkri0qV0THhQsvZtZeNNlLeCUQ16PZyv7cqutjDF35qw==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.17.2.tgz", + "integrity": "sha512-T19My13y8uYXPw/L/k0JYaX1fJKFT/PWdXiHr8mTbXWxjVF1t+8Xl31DgBBvEKclw+1b00Chg0hxE2O7bTG7GQ==", "cpu": [ - "ppc64le" + "ppc64" ], "dev": true, "optional": true, @@ -258,9 +262,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.14.1.tgz", - "integrity": "sha512-RWdiHuAxWmzPJgaHJdpvUUlDz8sdQz4P2uv367T2JocdDa98iRw2UjIJ4QxSyt077mXZT2X6pKfT2iYtVEvOFw==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.17.2.tgz", + "integrity": "sha512-BOaNfthf3X3fOWAB+IJ9kxTgPmMqPPH5f5k2DcCsRrBIbWnaJCgX2ll77dV1TdSy9SaXTR5iDXRL8n7AnoP5cg==", "cpu": [ "riscv64" ], @@ -271,9 +275,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.14.1.tgz", - "integrity": "sha512-VMgaGQ5zRX6ZqV/fas65/sUGc9cPmsntq2FiGmayW9KMNfWVG/j0BAqImvU4KTeOOgYSf1F+k6at1UfNONuNjA==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.17.2.tgz", + "integrity": "sha512-W0UP/x7bnn3xN2eYMql2T/+wpASLE5SjObXILTMPUBDB/Fg/FxC+gX4nvCfPBCbNhz51C+HcqQp2qQ4u25ok6g==", "cpu": [ "s390x" ], @@ -284,9 +288,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.14.1.tgz", - "integrity": "sha512-9Q7DGjZN+hTdJomaQ3Iub4m6VPu1r94bmK2z3UeWP3dGUecRC54tmVu9vKHTm1bOt3ASoYtEz6JSRLFzrysKlA==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.17.2.tgz", + "integrity": "sha512-Hy7pLwByUOuyaFC6mAr7m+oMC+V7qyifzs/nW2OJfC8H4hbCzOX07Ov0VFk/zP3kBsELWNFi7rJtgbKYsav9QQ==", "cpu": [ "x64" ], @@ -297,9 +301,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.14.1.tgz", - "integrity": "sha512-JNEG/Ti55413SsreTguSx0LOVKX902OfXIKVg+TCXO6Gjans/k9O6ww9q3oLGjNDaTLxM+IHFMeXy/0RXL5R/g==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.17.2.tgz", + "integrity": "sha512-h1+yTWeYbRdAyJ/jMiVw0l6fOOm/0D1vNLui9iPuqgRGnXA0u21gAqOyB5iHjlM9MMfNOm9RHCQ7zLIzT0x11Q==", "cpu": [ "x64" ], @@ -310,9 +314,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.14.1.tgz", - "integrity": "sha512-ryS22I9y0mumlLNwDFYZRDFLwWh3aKaC72CWjFcFvxK0U6v/mOkM5Up1bTbCRAhv3kEIwW2ajROegCIQViUCeA==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.17.2.tgz", + "integrity": "sha512-tmdtXMfKAjy5+IQsVtDiCfqbynAQE/TQRpWdVataHmhMb9DCoJxp9vLcCBjEQWMiUYxO1QprH/HbY9ragCEFLA==", "cpu": [ "arm64" ], @@ -323,9 +327,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.14.1.tgz", - "integrity": "sha512-TdloItiGk+T0mTxKx7Hp279xy30LspMso+GzQvV2maYePMAWdmrzqSNZhUpPj3CGw12aGj57I026PgLCTu8CGg==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.17.2.tgz", + "integrity": "sha512-7II/QCSTAHuE5vdZaQEwJq2ZACkBpQDOmQsE6D6XUbnBHW8IAhm4eTufL6msLJorzrHDFv3CF8oCA/hSIRuZeQ==", "cpu": [ "ia32" ], @@ -336,9 +340,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.14.1.tgz", - "integrity": "sha512-wQGI+LY/Py20zdUPq+XCem7JcPOyzIJBm3dli+56DJsQOHbnXZFEwgmnC6el1TPAfC8lBT3m+z69RmLykNUbew==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.17.2.tgz", + "integrity": "sha512-TGGO7v7qOq4CYmSBVEYpI1Y5xDuCEnbVC5Vth8mOsW0gDSzxNrVERPc790IGHsrT2dQSimgMr9Ub3Y1Jci5/8w==", "cpu": [ "x64" ], @@ -1087,17 +1091,17 @@ } }, "node_modules/optionator": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", - "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dev": true, "dependencies": { - "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", - "type-check": "^0.4.0" + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" }, "engines": { "node": ">= 0.8.0" @@ -1245,9 +1249,9 @@ } }, "node_modules/rollup": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.14.1.tgz", - "integrity": "sha512-4LnHSdd3QK2pa1J6dFbfm1HN0D7vSK/ZuZTsdyUAlA6Rr1yTouUTL13HaDOGJVgby461AhrNGBS7sCGXXtT+SA==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.17.2.tgz", + "integrity": "sha512-/9ClTJPByC0U4zNLowV1tMBe8yMEAxewtR3cUNX5BoEpGH3dQEWpJLr6CLp0fPdYRF/fzVOgvDb1zXuakwF5kQ==", "dev": true, "dependencies": { "@types/estree": "1.0.5" @@ -1260,21 +1264,22 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.14.1", - "@rollup/rollup-android-arm64": "4.14.1", - "@rollup/rollup-darwin-arm64": "4.14.1", - "@rollup/rollup-darwin-x64": "4.14.1", - "@rollup/rollup-linux-arm-gnueabihf": "4.14.1", - "@rollup/rollup-linux-arm64-gnu": "4.14.1", - "@rollup/rollup-linux-arm64-musl": "4.14.1", - "@rollup/rollup-linux-powerpc64le-gnu": "4.14.1", - "@rollup/rollup-linux-riscv64-gnu": "4.14.1", - "@rollup/rollup-linux-s390x-gnu": "4.14.1", - "@rollup/rollup-linux-x64-gnu": "4.14.1", - "@rollup/rollup-linux-x64-musl": "4.14.1", - "@rollup/rollup-win32-arm64-msvc": "4.14.1", - "@rollup/rollup-win32-ia32-msvc": "4.14.1", - "@rollup/rollup-win32-x64-msvc": "4.14.1", + "@rollup/rollup-android-arm-eabi": "4.17.2", + "@rollup/rollup-android-arm64": "4.17.2", + "@rollup/rollup-darwin-arm64": "4.17.2", + "@rollup/rollup-darwin-x64": "4.17.2", + "@rollup/rollup-linux-arm-gnueabihf": "4.17.2", + "@rollup/rollup-linux-arm-musleabihf": "4.17.2", + "@rollup/rollup-linux-arm64-gnu": "4.17.2", + "@rollup/rollup-linux-arm64-musl": "4.17.2", + "@rollup/rollup-linux-powerpc64le-gnu": "4.17.2", + "@rollup/rollup-linux-riscv64-gnu": "4.17.2", + "@rollup/rollup-linux-s390x-gnu": "4.17.2", + "@rollup/rollup-linux-x64-gnu": "4.17.2", + "@rollup/rollup-linux-x64-musl": "4.17.2", + "@rollup/rollup-win32-arm64-msvc": "4.17.2", + "@rollup/rollup-win32-ia32-msvc": "4.17.2", + "@rollup/rollup-win32-x64-msvc": "4.17.2", "fsevents": "~2.3.2" } }, @@ -1401,9 +1406,9 @@ } }, "node_modules/typescript": { - "version": "5.4.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.4.tgz", - "integrity": "sha512-dGE2Vv8cpVvw28v8HCPqyb08EzbBURxDpuhJvTrusShUfGnhHBafDsLdS1EhhxyL6BJQE+2cT3dDPAv+MQ6oLw==", + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -1467,6 +1472,15 @@ "node": ">= 8" } }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",