cron 4.1.0 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/dist/time.d.ts +9 -6
- package/dist/time.js +50 -171
- package/package.json +13 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,38 @@
|
|
|
1
|
+
## [4.1.1](https://github.com/kelektiv/node-cron/compare/v4.1.0...v4.1.1) (2025-03-26)
|
|
2
|
+
|
|
3
|
+
### 🐛 Bug Fixes
|
|
4
|
+
|
|
5
|
+
* cron should still execute after changing the time back during daylight savings ([#966](https://github.com/kelektiv/node-cron/issues/966)) ([8cf0712](https://github.com/kelektiv/node-cron/commit/8cf07121290beb1b9e1a33bd393503fa031c691a)), closes [#881](https://github.com/kelektiv/node-cron/issues/881) [#881](https://github.com/kelektiv/node-cron/issues/881)
|
|
6
|
+
|
|
7
|
+
### ♻️ Chores
|
|
8
|
+
|
|
9
|
+
* **action:** update actions/setup-node action to v4.3.0 ([e70709f](https://github.com/kelektiv/node-cron/commit/e70709f3b004f8ccdddbebf308e85aeabf76ffb5))
|
|
10
|
+
* **action:** update actions/upload-artifact action to v4.6.1 ([06ed76c](https://github.com/kelektiv/node-cron/commit/06ed76c0f0947132eb951b13503f7cb0db797880))
|
|
11
|
+
* **action:** update actions/upload-artifact action to v4.6.2 ([69ea222](https://github.com/kelektiv/node-cron/commit/69ea2223febff26b5dd0074bde002f218ba93c4c))
|
|
12
|
+
* **action:** update github/codeql-action action to v3.28.10 ([1d14a08](https://github.com/kelektiv/node-cron/commit/1d14a0896732686dbc1020fb3ba9d0bf890acec4))
|
|
13
|
+
* **action:** update github/codeql-action action to v3.28.11 ([cd28d4f](https://github.com/kelektiv/node-cron/commit/cd28d4ffb7000c35d766b564f33d2988be5b4601))
|
|
14
|
+
* **action:** update github/codeql-action action to v3.28.13 ([154f885](https://github.com/kelektiv/node-cron/commit/154f885d2da0c203395daa746a9fd3c378d35ab8))
|
|
15
|
+
* **action:** update ossf/scorecard-action action to v2.4.1 ([6a4ec39](https://github.com/kelektiv/node-cron/commit/6a4ec391836848fa4fa0949cc03acb0da1d1cf6b))
|
|
16
|
+
* **deps:** lock file maintenance ([6742c01](https://github.com/kelektiv/node-cron/commit/6742c01a10ec1651de29897d826b0fa21e5f44fc))
|
|
17
|
+
* **deps:** lock file maintenance ([a97cdb1](https://github.com/kelektiv/node-cron/commit/a97cdb19b2c179c1e7fcb07c8f5357299e252a13))
|
|
18
|
+
* **deps:** lock file maintenance ([c585973](https://github.com/kelektiv/node-cron/commit/c585973bf822713a8c0c9006074827732130f345))
|
|
19
|
+
* **deps:** lock file maintenance ([e156aa7](https://github.com/kelektiv/node-cron/commit/e156aa768821ca644c61ddd1387764aa817c85ca))
|
|
20
|
+
* **deps:** update dependency [@commitlint](https://github.com/commitlint)/cli to v19.8.0 ([3984884](https://github.com/kelektiv/node-cron/commit/3984884b29315d73c7323f52d238480e31da1ba3))
|
|
21
|
+
* **deps:** update dependency [@eslint](https://github.com/eslint)/js to v9.22.0 ([7415480](https://github.com/kelektiv/node-cron/commit/7415480ccafddad023f62df6cd9ca975930c8315))
|
|
22
|
+
* **deps:** update dependency [@eslint](https://github.com/eslint)/js to v9.23.0 ([00fc7ed](https://github.com/kelektiv/node-cron/commit/00fc7ed1e679f31eeef1a057cbb791bd415c76e7))
|
|
23
|
+
* **deps:** update dependency [@fast-check](https://github.com/fast-check)/jest to v2.1.0 ([a9a8608](https://github.com/kelektiv/node-cron/commit/a9a860807f01fe8526e0d8983b6371ceb27c68dd))
|
|
24
|
+
* **deps:** update dependency [@types](https://github.com/types)/node to v22.13.11 ([38cf6a6](https://github.com/kelektiv/node-cron/commit/38cf6a6ce15d17d888b6103457c4a0c8cb4a1019))
|
|
25
|
+
* **deps:** update dependency [@types](https://github.com/types)/node to v22.13.5 ([a746320](https://github.com/kelektiv/node-cron/commit/a746320f3efe92e47423cf949f42ed1eef945a45))
|
|
26
|
+
* **deps:** update dependency [@types](https://github.com/types)/node to v22.13.9 ([4ac339f](https://github.com/kelektiv/node-cron/commit/4ac339fe4848e20caad97844a283df5a4344bedd))
|
|
27
|
+
* **deps:** update dependency lint-staged to v15.5.0 ([5efb27f](https://github.com/kelektiv/node-cron/commit/5efb27f1e1657fc439781ba3ea1fdb2e571ea03e))
|
|
28
|
+
* **deps:** update dependency prettier to v3.5.3 ([d8f2456](https://github.com/kelektiv/node-cron/commit/d8f245616d1415fa08569ac571af4db77ed7f4ab))
|
|
29
|
+
* **deps:** update dependency sinon to v19.0.4 ([5144f4d](https://github.com/kelektiv/node-cron/commit/5144f4dfd90d0755591200cf957b3aff76f52afb))
|
|
30
|
+
* **deps:** update dependency ts-jest to v29.2.6 ([3625528](https://github.com/kelektiv/node-cron/commit/3625528fbcd2fd0e3da63a03e80271541fe92086))
|
|
31
|
+
* **deps:** update dependency typescript to v5.8.2 ([4ef66e8](https://github.com/kelektiv/node-cron/commit/4ef66e84985b5b2259ae67aded6391f5cbd3a5ec))
|
|
32
|
+
* **deps:** update linters ([ecbe916](https://github.com/kelektiv/node-cron/commit/ecbe916c825663839038e94a23aefe5c91744fe5))
|
|
33
|
+
* **deps:** update node.js to v23.10.0 ([#970](https://github.com/kelektiv/node-cron/issues/970)) ([6775fff](https://github.com/kelektiv/node-cron/commit/6775fff2d06798954d60cc66964e2b671a8be1e7))
|
|
34
|
+
* **deps:** update tests ([5d5e555](https://github.com/kelektiv/node-cron/commit/5d5e55527a5dc108f814f5ab8825e405b91a467d))
|
|
35
|
+
|
|
1
36
|
## [4.1.0](https://github.com/kelektiv/node-cron/compare/v4.0.0...v4.1.0) (2025-02-24)
|
|
2
37
|
|
|
3
38
|
### ✨ Features
|
package/dist/time.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { DateTime, Zone } from 'luxon';
|
|
2
2
|
import { CronError } from './errors';
|
|
3
3
|
import { CronJobParams } from './types/cron.types';
|
|
4
|
+
type CustomZone = Zone & {
|
|
5
|
+
zoneName?: string;
|
|
6
|
+
fixed?: string;
|
|
7
|
+
};
|
|
8
|
+
type CustomDateTime = Omit<DateTime, 'zone'> & {
|
|
9
|
+
zone: CustomZone;
|
|
10
|
+
};
|
|
4
11
|
export declare class CronTime {
|
|
5
12
|
source: string | DateTime;
|
|
6
13
|
timeZone?: string;
|
|
@@ -24,14 +31,10 @@ export declare class CronTime {
|
|
|
24
31
|
getTimeout(): number;
|
|
25
32
|
toString(): string;
|
|
26
33
|
toJSON(): string[];
|
|
27
|
-
getNextDateFrom(start: Date |
|
|
28
|
-
private _findPreviousDSTJump;
|
|
29
|
-
private _checkTimeInSkippedRange;
|
|
30
|
-
private _checkTimeInSkippedRangeSingleHour;
|
|
31
|
-
private _checkTimeInSkippedRangeMultiHour;
|
|
32
|
-
private _forwardDSTJump;
|
|
34
|
+
getNextDateFrom(start: Date | CustomDateTime, timeZone?: string | CustomZone): DateTime;
|
|
33
35
|
private _wcOrAll;
|
|
34
36
|
private _hasAll;
|
|
35
37
|
private _parse;
|
|
36
38
|
private _parseField;
|
|
37
39
|
}
|
|
40
|
+
export {};
|
package/dist/time.js
CHANGED
|
@@ -56,7 +56,7 @@ class CronTime {
|
|
|
56
56
|
sendAt(i) {
|
|
57
57
|
let date = this.realDate && this.source instanceof luxon_1.DateTime
|
|
58
58
|
? this.source
|
|
59
|
-
: luxon_1.DateTime.
|
|
59
|
+
: luxon_1.DateTime.utc();
|
|
60
60
|
if (this.timeZone) {
|
|
61
61
|
date = date.setZone(this.timeZone);
|
|
62
62
|
}
|
|
@@ -79,7 +79,8 @@ class CronTime {
|
|
|
79
79
|
return date;
|
|
80
80
|
}
|
|
81
81
|
if (i === undefined || isNaN(i) || i < 0) {
|
|
82
|
-
|
|
82
|
+
const nextDate = this.getNextDateFrom(date);
|
|
83
|
+
return nextDate;
|
|
83
84
|
}
|
|
84
85
|
else {
|
|
85
86
|
const dates = [];
|
|
@@ -91,7 +92,7 @@ class CronTime {
|
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
94
|
getTimeout() {
|
|
94
|
-
return Math.max(-1, this.sendAt().toMillis() - luxon_1.DateTime.
|
|
95
|
+
return Math.max(-1, this.sendAt().toMillis() - luxon_1.DateTime.utc().toMillis());
|
|
95
96
|
}
|
|
96
97
|
toString() {
|
|
97
98
|
return this.toJSON().join(' ');
|
|
@@ -102,15 +103,20 @@ class CronTime {
|
|
|
102
103
|
});
|
|
103
104
|
}
|
|
104
105
|
getNextDateFrom(start, timeZone) {
|
|
105
|
-
var _a;
|
|
106
|
+
var _a, _b;
|
|
106
107
|
if (start instanceof Date) {
|
|
107
108
|
start = luxon_1.DateTime.fromJSDate(start);
|
|
108
109
|
}
|
|
109
|
-
let date = start;
|
|
110
|
-
const firstDate = start.toMillis();
|
|
111
110
|
if (timeZone) {
|
|
112
|
-
|
|
111
|
+
start = start.setZone(timeZone);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
timeZone = (_a = start.zone.zoneName) !== null && _a !== void 0 ? _a : start.zone.fixed;
|
|
113
115
|
}
|
|
116
|
+
let date = luxon_1.DateTime.fromFormat(`${start.year}-${start.month}-${start.day} ${start.hour}:${start.minute}:${start.second}`, 'yyyy-M-d H:m:s', {
|
|
117
|
+
zone: 'UTC'
|
|
118
|
+
});
|
|
119
|
+
const firstDate = date.toMillis();
|
|
114
120
|
if (!this.realDate) {
|
|
115
121
|
if (date.millisecond > 0) {
|
|
116
122
|
date = date.set({ millisecond: 0, second: date.second + 1 });
|
|
@@ -121,202 +127,75 @@ class CronTime {
|
|
|
121
127
|
}
|
|
122
128
|
const maxMatch = luxon_1.DateTime.now().plus({ years: 8 });
|
|
123
129
|
while (true) {
|
|
124
|
-
const diff = date.toMillis() - start.toMillis();
|
|
125
130
|
if (date > maxMatch) {
|
|
126
131
|
throw new errors_1.CronError(`Something went wrong. No execution date was found in the next 8 years.
|
|
127
132
|
Please provide the following string if you would like to help debug:
|
|
128
|
-
Time Zone: ${(
|
|
133
|
+
Time Zone: ${(_b = timeZone === null || timeZone === void 0 ? void 0 : timeZone.toString()) !== null && _b !== void 0 ? _b : '""'} - Cron String: ${this.source.toString()} - UTC offset: ${date.offset} - current Date: ${luxon_1.DateTime.local().toString()}`);
|
|
129
134
|
}
|
|
130
135
|
if (!(date.month in this.month) &&
|
|
131
136
|
Object.keys(this.month).length !== 12) {
|
|
132
|
-
date = date.plus({
|
|
137
|
+
date = date.plus({ month: 1 });
|
|
133
138
|
date = date.set({ day: 1, hour: 0, minute: 0, second: 0 });
|
|
134
|
-
if (this._forwardDSTJump(0, 0, date)) {
|
|
135
|
-
const [isDone, newDate] = this._findPreviousDSTJump(date);
|
|
136
|
-
date = newDate;
|
|
137
|
-
if (isDone)
|
|
138
|
-
break;
|
|
139
|
-
}
|
|
140
139
|
continue;
|
|
141
140
|
}
|
|
142
|
-
if (!(date.day in this.dayOfMonth) &&
|
|
141
|
+
if ((!(date.day in this.dayOfMonth) &&
|
|
143
142
|
Object.keys(this.dayOfMonth).length !== 31 &&
|
|
144
143
|
!(this._getWeekDay(date) in this.dayOfWeek &&
|
|
145
|
-
Object.keys(this.dayOfWeek).length !== 7))
|
|
146
|
-
date
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
date = newDate;
|
|
151
|
-
if (isDone)
|
|
152
|
-
break;
|
|
153
|
-
}
|
|
154
|
-
continue;
|
|
155
|
-
}
|
|
156
|
-
if (!(this._getWeekDay(date) in this.dayOfWeek) &&
|
|
157
|
-
Object.keys(this.dayOfWeek).length !== 7 &&
|
|
158
|
-
!(date.day in this.dayOfMonth &&
|
|
159
|
-
Object.keys(this.dayOfMonth).length !== 31)) {
|
|
144
|
+
Object.keys(this.dayOfWeek).length !== 7)) ||
|
|
145
|
+
(!(this._getWeekDay(date) in this.dayOfWeek) &&
|
|
146
|
+
Object.keys(this.dayOfWeek).length !== 7 &&
|
|
147
|
+
!(date.day in this.dayOfMonth &&
|
|
148
|
+
Object.keys(this.dayOfMonth).length !== 31))) {
|
|
160
149
|
date = date.plus({ days: 1 });
|
|
161
150
|
date = date.set({ hour: 0, minute: 0, second: 0 });
|
|
162
|
-
if (this._forwardDSTJump(0, 0, date)) {
|
|
163
|
-
const [isDone, newDate] = this._findPreviousDSTJump(date);
|
|
164
|
-
date = newDate;
|
|
165
|
-
if (isDone)
|
|
166
|
-
break;
|
|
167
|
-
}
|
|
168
151
|
continue;
|
|
169
152
|
}
|
|
170
153
|
if (!(date.hour in this.hour) && Object.keys(this.hour).length !== 24) {
|
|
171
|
-
|
|
172
|
-
const expectedMinute = date.minute;
|
|
173
|
-
date = date.set({ hour: expectedHour });
|
|
154
|
+
date = date.plus({ hour: 1 });
|
|
174
155
|
date = date.set({ minute: 0, second: 0 });
|
|
175
|
-
if (this._forwardDSTJump(expectedHour, expectedMinute, date)) {
|
|
176
|
-
const [isDone, newDate] = this._findPreviousDSTJump(date);
|
|
177
|
-
date = newDate;
|
|
178
|
-
if (isDone)
|
|
179
|
-
break;
|
|
180
|
-
}
|
|
181
156
|
continue;
|
|
182
157
|
}
|
|
183
158
|
if (!(date.minute in this.minute) &&
|
|
184
159
|
Object.keys(this.minute).length !== 60) {
|
|
185
|
-
|
|
186
|
-
const expectedHour = date.hour + (expectedMinute === 60 ? 1 : 0);
|
|
187
|
-
date = date.set({ minute: expectedMinute });
|
|
160
|
+
date = date.plus({ minute: 1 });
|
|
188
161
|
date = date.set({ second: 0 });
|
|
189
|
-
if (this._forwardDSTJump(expectedHour, expectedMinute, date)) {
|
|
190
|
-
const [isDone, newDate] = this._findPreviousDSTJump(date);
|
|
191
|
-
date = newDate;
|
|
192
|
-
if (isDone)
|
|
193
|
-
break;
|
|
194
|
-
}
|
|
195
|
-
continue;
|
|
196
|
-
}
|
|
197
|
-
if (!(date.second in this.second) &&
|
|
198
|
-
Object.keys(this.second).length !== 60) {
|
|
199
|
-
const expectedSecond = date.second === 59 && diff > 60000 ? 0 : date.second + 1;
|
|
200
|
-
const expectedMinute = date.minute + (expectedSecond === 60 ? 1 : 0);
|
|
201
|
-
const expectedHour = date.hour + (expectedMinute === 60 ? 1 : 0);
|
|
202
|
-
date = date.set({ second: expectedSecond });
|
|
203
|
-
if (this._forwardDSTJump(expectedHour, expectedMinute, date)) {
|
|
204
|
-
const [isDone, newDate] = this._findPreviousDSTJump(date);
|
|
205
|
-
date = newDate;
|
|
206
|
-
if (isDone)
|
|
207
|
-
break;
|
|
208
|
-
}
|
|
209
162
|
continue;
|
|
210
163
|
}
|
|
211
|
-
if (date.toMillis() === firstDate
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
date = date.set({ second: expectedSecond });
|
|
216
|
-
if (this._forwardDSTJump(expectedHour, expectedMinute, date)) {
|
|
217
|
-
const [isDone, newDate] = this._findPreviousDSTJump(date);
|
|
218
|
-
date = newDate;
|
|
219
|
-
if (isDone)
|
|
220
|
-
break;
|
|
221
|
-
}
|
|
164
|
+
if (date.toMillis() === firstDate ||
|
|
165
|
+
(!(date.second in this.second) &&
|
|
166
|
+
Object.keys(this.second).length !== 60)) {
|
|
167
|
+
date = date.plus({ second: 1 });
|
|
222
168
|
continue;
|
|
223
169
|
}
|
|
224
170
|
break;
|
|
225
171
|
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
throw new errors_1.CronError(`ERROR: This DST checking related function assumes the input DateTime (${(_a = date.toISO()) !== null && _a !== void 0 ? _a : date.toMillis()}) is within 24 hours of a DST jump.`);
|
|
237
|
-
}
|
|
238
|
-
expectedMinute = maybeJumpingPoint.minute - 1;
|
|
239
|
-
expectedHour = maybeJumpingPoint.hour;
|
|
240
|
-
if (expectedMinute < 0) {
|
|
241
|
-
expectedMinute += 60;
|
|
242
|
-
expectedHour = (expectedHour + 24 - 1) % 24;
|
|
172
|
+
const expectedHour = date.hour;
|
|
173
|
+
const expectedMinute = date.minute;
|
|
174
|
+
date = luxon_1.DateTime.fromFormat(`${date.year}-${date.month}-${date.day} ${date.hour}:${date.minute}:${date.second}`, 'yyyy-M-d H:m:s', {
|
|
175
|
+
zone: timeZone
|
|
176
|
+
});
|
|
177
|
+
const nonDSTReferenceDate = luxon_1.DateTime.fromFormat(`${date.year}-1-1 0:0:0`, 'yyyy-M-d H:m:s', { zone: timeZone });
|
|
178
|
+
if ((expectedHour !== date.hour || expectedMinute !== date.minute) &&
|
|
179
|
+
nonDSTReferenceDate.offset !== date.offset) {
|
|
180
|
+
while (date.minus({ minute: 1 }).offset !== nonDSTReferenceDate.offset) {
|
|
181
|
+
date = date.minus({ minute: 1 });
|
|
243
182
|
}
|
|
244
|
-
|
|
245
|
-
actualMinute = maybeJumpingPoint.minute;
|
|
246
|
-
actualHour = maybeJumpingPoint.hour;
|
|
247
|
-
} while (expectedMinute === actualMinute && expectedHour === actualHour);
|
|
248
|
-
const afterJumpingPoint = maybeJumpingPoint
|
|
249
|
-
.plus({ minute: 1 })
|
|
250
|
-
.set({ second: 0, millisecond: 0 });
|
|
251
|
-
const beforeJumpingPoint = afterJumpingPoint.minus({ second: 1 });
|
|
252
|
-
if (date.month in this.month &&
|
|
253
|
-
date.day in this.dayOfMonth &&
|
|
254
|
-
this._getWeekDay(date) in this.dayOfWeek) {
|
|
255
|
-
return [
|
|
256
|
-
this._checkTimeInSkippedRange(beforeJumpingPoint, afterJumpingPoint),
|
|
257
|
-
afterJumpingPoint
|
|
258
|
-
];
|
|
259
|
-
}
|
|
260
|
-
return [false, afterJumpingPoint];
|
|
261
|
-
}
|
|
262
|
-
_checkTimeInSkippedRange(beforeJumpingPoint, afterJumpingPoint) {
|
|
263
|
-
const startingMinute = (beforeJumpingPoint.minute + 1) % 60;
|
|
264
|
-
const startingHour = (beforeJumpingPoint.hour + (startingMinute === 0 ? 1 : 0)) % 24;
|
|
265
|
-
const hourRangeSize = afterJumpingPoint.hour - startingHour + 1;
|
|
266
|
-
const isHourJump = startingMinute === 0 && afterJumpingPoint.minute === 0;
|
|
267
|
-
if (hourRangeSize === 2 && isHourJump) {
|
|
268
|
-
return startingHour in this.hour;
|
|
269
|
-
}
|
|
270
|
-
else if (hourRangeSize === 1) {
|
|
271
|
-
return (startingHour in this.hour &&
|
|
272
|
-
this._checkTimeInSkippedRangeSingleHour(startingMinute, afterJumpingPoint.minute));
|
|
183
|
+
return date;
|
|
273
184
|
}
|
|
274
|
-
|
|
275
|
-
|
|
185
|
+
const hourTestDate = date.minus({ hour: 1 });
|
|
186
|
+
const twoHourTestDate = date.minus({ hour: 2 });
|
|
187
|
+
if ((hourTestDate.hour === date.hour ||
|
|
188
|
+
twoHourTestDate.hour === hourTestDate.hour) &&
|
|
189
|
+
hourTestDate > start) {
|
|
190
|
+
date = hourTestDate;
|
|
276
191
|
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
}
|
|
283
|
-
return endMinute in this.minute && 0 in this.second;
|
|
284
|
-
}
|
|
285
|
-
_checkTimeInSkippedRangeMultiHour(startHour, startMinute, endHour, endMinute) {
|
|
286
|
-
if (startHour >= endHour) {
|
|
287
|
-
throw new errors_1.CronError(`ERROR: This DST checking related function assumes the forward jump starting hour (${startHour}) is less than the end hour (${endHour})`);
|
|
192
|
+
const halfHourTestDate = date.minus({ minute: 30 });
|
|
193
|
+
if ((halfHourTestDate.minute === date.minute ||
|
|
194
|
+
hourTestDate.minute === halfHourTestDate.minute) &&
|
|
195
|
+
halfHourTestDate > start) {
|
|
196
|
+
date = halfHourTestDate;
|
|
288
197
|
}
|
|
289
|
-
|
|
290
|
-
const lastHourMinuteRange = Array.from({ length: endMinute }, (_, k) => k);
|
|
291
|
-
const middleHourMinuteRange = Array.from({ length: 60 }, (_, k) => k);
|
|
292
|
-
const selectRange = (forHour) => {
|
|
293
|
-
if (forHour === startHour) {
|
|
294
|
-
return firstHourMinuteRange;
|
|
295
|
-
}
|
|
296
|
-
else if (forHour === endHour) {
|
|
297
|
-
return lastHourMinuteRange;
|
|
298
|
-
}
|
|
299
|
-
else {
|
|
300
|
-
return middleHourMinuteRange;
|
|
301
|
-
}
|
|
302
|
-
};
|
|
303
|
-
for (let hour = startHour; hour <= endHour; ++hour) {
|
|
304
|
-
if (!(hour in this.hour))
|
|
305
|
-
continue;
|
|
306
|
-
const usingRange = selectRange(hour);
|
|
307
|
-
for (const minute of usingRange) {
|
|
308
|
-
if (minute in this.minute)
|
|
309
|
-
return true;
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
return endHour in this.hour && endMinute in this.minute && 0 in this.second;
|
|
313
|
-
}
|
|
314
|
-
_forwardDSTJump(expectedHour, expectedMinute, actualDate) {
|
|
315
|
-
const actualHour = actualDate.hour;
|
|
316
|
-
const actualMinute = actualDate.minute;
|
|
317
|
-
const didHoursJumped = expectedHour % 24 < actualHour;
|
|
318
|
-
const didMinutesJumped = expectedMinute % 60 < actualMinute;
|
|
319
|
-
return didHoursJumped || didMinutesJumped;
|
|
198
|
+
return date;
|
|
320
199
|
}
|
|
321
200
|
_wcOrAll(unit) {
|
|
322
201
|
if (this._hasAll(unit)) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cron",
|
|
3
3
|
"description": "Cron jobs for your node",
|
|
4
|
-
"version": "4.1.
|
|
4
|
+
"version": "4.1.1",
|
|
5
5
|
"author": "Nick Campbell <nicholas.j.campbell@gmail.com> (https://github.com/ncb000gt)",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/kelektiv/node-cron/issues"
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"luxon": "~3.5.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@commitlint/cli": "19.
|
|
32
|
-
"@eslint/js": "9.
|
|
33
|
-
"@fast-check/jest": "2.0
|
|
31
|
+
"@commitlint/cli": "19.8.0",
|
|
32
|
+
"@eslint/js": "9.23.0",
|
|
33
|
+
"@fast-check/jest": "2.1.0",
|
|
34
34
|
"@insurgent/commitlint-config": "20.0.0",
|
|
35
35
|
"@insurgent/conventional-changelog-preset": "10.0.0",
|
|
36
36
|
"@semantic-release/changelog": "6.0.3",
|
|
@@ -39,22 +39,23 @@
|
|
|
39
39
|
"@semantic-release/github": "11.0.1",
|
|
40
40
|
"@semantic-release/npm": "12.0.1",
|
|
41
41
|
"@semantic-release/release-notes-generator": "14.0.3",
|
|
42
|
+
"@swc/core": "^1.10.18",
|
|
43
|
+
"@swc/jest": "^0.2.37",
|
|
42
44
|
"@types/jest": "29.5.14",
|
|
43
|
-
"@types/node": "22.13.
|
|
44
|
-
"@types/sinon": "17.0.
|
|
45
|
-
"chai": "5.
|
|
45
|
+
"@types/node": "22.13.11",
|
|
46
|
+
"@types/sinon": "17.0.4",
|
|
47
|
+
"chai": "5.2.0",
|
|
46
48
|
"eslint": "8.57.1",
|
|
47
49
|
"eslint-config-prettier": "9.1.0",
|
|
48
50
|
"eslint-plugin-jest": "27.9.0",
|
|
49
51
|
"eslint-plugin-prettier": "5.2.3",
|
|
50
52
|
"husky": "9.1.7",
|
|
51
53
|
"jest": "29.7.0",
|
|
52
|
-
"lint-staged": "15.
|
|
53
|
-
"prettier": "3.5.
|
|
54
|
+
"lint-staged": "15.5.0",
|
|
55
|
+
"prettier": "3.5.3",
|
|
54
56
|
"semantic-release": "24.2.3",
|
|
55
|
-
"sinon": "19.0.
|
|
56
|
-
"
|
|
57
|
-
"typescript": "5.7.3",
|
|
57
|
+
"sinon": "19.0.4",
|
|
58
|
+
"typescript": "5.8.2",
|
|
58
59
|
"typescript-eslint": "7.18.0"
|
|
59
60
|
},
|
|
60
61
|
"keywords": [
|