rrule-temporal 2.2.0 → 2.2.2
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/README.md +2 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +44 -10
- package/dist/index.d.ts +44 -10
- package/dist/index.js +1 -1
- package/dist/{src-C6VoiyAb.cjs → src-B2AIB5jJ.cjs} +340 -169
- package/dist/{src-BY_Cxfjq.js → src-B2XO5sNr.js} +340 -169
- package/dist/totext.cjs +1 -1
- package/dist/totext.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -111,7 +111,8 @@ below. These correspond to the recurrence rule parts defined in RFC 5545:
|
|
|
111
111
|
| `rDate` | Additional dates to include. |
|
|
112
112
|
| `exDate` | Exception dates to exclude. |
|
|
113
113
|
| `tzid` | Time zone identifier for interpreting dates. |
|
|
114
|
-
| `maxIterations` | Safety cap
|
|
114
|
+
| `maxIterations` | Safety cap for advancing outer recurrence periods (defaults to 10,000). |
|
|
115
|
+
| `maxCandidateEvaluations` | Safety cap for candidate datetimes evaluated within recurrence periods (defaults to 1,000,000). |
|
|
115
116
|
| `includeDtstart` | Include `DTSTART` even if it does not match the pattern. |
|
|
116
117
|
| `strict` | Enforce RFC 5545 constraints strictly (defaults to false). |
|
|
117
118
|
| `temporal` | Optional Temporal namespace used for public output values and their inferred types. |
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_src = require("./src-
|
|
2
|
+
const require_src = require("./src-B2AIB5jJ.cjs");
|
|
3
3
|
exports.RRuleTemporal = require_src.RRuleTemporal;
|
|
4
4
|
exports.allowedFreq = require_src.allowedFreq;
|
|
5
5
|
exports.allowedWeekdays = require_src.allowedWeekdays;
|
package/dist/index.d.cts
CHANGED
|
@@ -14,8 +14,10 @@ interface BaseOpts<TOutput extends TemporalZonedDateTimeInput = TemporalZonedDat
|
|
|
14
14
|
temporal?: TemporalImplementation<TOutput>;
|
|
15
15
|
/** Time zone identifier as defined in RFC 5545 §3.2.19. */
|
|
16
16
|
tzid?: string;
|
|
17
|
-
/** Safety cap
|
|
17
|
+
/** Safety cap for advancing outer recurrence periods. */
|
|
18
18
|
maxIterations?: number;
|
|
19
|
+
/** Safety cap for candidate datetimes evaluated inside recurrence periods. */
|
|
20
|
+
maxCandidateEvaluations?: number;
|
|
19
21
|
/** Include DTSTART as an occurrence even if it does not match the rule pattern. */
|
|
20
22
|
includeDtstart?: boolean;
|
|
21
23
|
/** Enforce RFC 5545 constraints strictly (defaults to false). */
|
|
@@ -113,6 +115,7 @@ declare class RRuleTemporal<TOutput extends TemporalZonedDateTimeInput = Tempora
|
|
|
113
115
|
private readonly opts;
|
|
114
116
|
private readonly outputTemporal?;
|
|
115
117
|
private readonly maxIterations;
|
|
118
|
+
private readonly maxCandidateEvaluations;
|
|
116
119
|
private readonly includeDtstart;
|
|
117
120
|
private readonly parsedByDayTokens?;
|
|
118
121
|
private readonly simpleByDayIsoDays?;
|
|
@@ -149,6 +152,29 @@ declare class RRuleTemporal<TOutput extends TemporalZonedDateTimeInput = Tempora
|
|
|
149
152
|
* present the original date is returned unchanged.
|
|
150
153
|
*/
|
|
151
154
|
private expandByTime;
|
|
155
|
+
private localDateKey;
|
|
156
|
+
private sortedUniqueDateCandidates;
|
|
157
|
+
private timeOfDayNanoseconds;
|
|
158
|
+
private timeSlotNanoseconds;
|
|
159
|
+
/**
|
|
160
|
+
* `ZonedDateTime.with()` can reorder or alias wall-clock slots on a day with
|
|
161
|
+
* an offset transition (notably when a spring-forward gap is resolved). On
|
|
162
|
+
* those uncommon dates we retain the legacy sort semantics with a bounded
|
|
163
|
+
* one-day fallback instead of ever materializing a whole recurrence period.
|
|
164
|
+
*/
|
|
165
|
+
private needsSortedTimeFallback;
|
|
166
|
+
private createCandidateWorkBudget;
|
|
167
|
+
private recordCandidateEvaluation;
|
|
168
|
+
/**
|
|
169
|
+
* Visit BYHOUR x BYMINUTE x BYSECOND without allocating the Cartesian
|
|
170
|
+
* product. Returning false from `visit` terminates the innermost traversal
|
|
171
|
+
* immediately. The optional bounds are only supplied for the same local
|
|
172
|
+
* calendar date by `visitDateTimeCandidates`.
|
|
173
|
+
*/
|
|
174
|
+
private visitTimeSlots;
|
|
175
|
+
private visitDateTimeCandidates;
|
|
176
|
+
/** Apply BYSETPOS with bounded forward/reverse passes over one period. */
|
|
177
|
+
private visitPeriodCandidates;
|
|
152
178
|
private nextCandidateSameDate;
|
|
153
179
|
private applyTimeOverride;
|
|
154
180
|
private computeFirst;
|
|
@@ -163,6 +189,12 @@ declare class RRuleTemporal<TOutput extends TemporalZonedDateTimeInput = Tempora
|
|
|
163
189
|
private matchesByYearDay;
|
|
164
190
|
private getIsoWeekInfo;
|
|
165
191
|
private matchesByWeekNo;
|
|
192
|
+
/**
|
|
193
|
+
* Gregorian weekday and leap-year patterns repeat every 400 years. Checking
|
|
194
|
+
* a complete cycle lets impossible BYYEARDAY + BYWEEKNO intersections stop
|
|
195
|
+
* without incorrectly judging the rule from DTSTART's year alone.
|
|
196
|
+
*/
|
|
197
|
+
private hasPossibleYearDayWeekNoCombination;
|
|
166
198
|
options(): RRuleResolvedOptions<TOutput>;
|
|
167
199
|
private cloneOptions;
|
|
168
200
|
private cloneUpdateOptions;
|
|
@@ -203,7 +235,6 @@ declare class RRuleTemporal<TOutput extends TemporalZonedDateTimeInput = Tempora
|
|
|
203
235
|
private buildMonthlyOccurrenceOnDay;
|
|
204
236
|
private applyBySetPosToSortedList;
|
|
205
237
|
private generateMonthlyOccurrenceDays;
|
|
206
|
-
private generateMonthlyOccurrencesOptimizedBySetPos;
|
|
207
238
|
private isGregorianLeapYear;
|
|
208
239
|
private daysInGregorianMonth;
|
|
209
240
|
private gregorianIsoDayOfWeek;
|
|
@@ -231,6 +262,8 @@ declare class RRuleTemporal<TOutput extends TemporalZonedDateTimeInput = Tempora
|
|
|
231
262
|
private _allTzWeeklyExpanded;
|
|
232
263
|
private _allTzMonthlyByDayOrMonthDay;
|
|
233
264
|
private processOccurrences;
|
|
265
|
+
/** Process one occurrence and report whether generation should continue. */
|
|
266
|
+
private processOccurrence;
|
|
234
267
|
/**
|
|
235
268
|
* Returns all occurrences of the rule.
|
|
236
269
|
* @param iterator - An optional callback iterator function that can be used to filter or modify the occurrences.
|
|
@@ -352,17 +385,18 @@ declare class RRuleTemporal<TOutput extends TemporalZonedDateTimeInput = Tempora
|
|
|
352
385
|
private formatIcsDateTime;
|
|
353
386
|
private joinDates;
|
|
354
387
|
/**
|
|
355
|
-
*
|
|
356
|
-
*
|
|
388
|
+
* Resolve the calendar dates selected within a month without expanding any
|
|
389
|
+
* time BY-parts. This keeps the intermediate set bounded to calendar scale.
|
|
357
390
|
*/
|
|
391
|
+
private generateMonthlyDateCandidates;
|
|
358
392
|
private generateMonthlyOccurrences;
|
|
359
393
|
/**
|
|
360
|
-
*
|
|
361
|
-
*
|
|
362
|
-
*
|
|
394
|
+
* Resolve one recurrence year's matching calendar dates. BYHOUR,
|
|
395
|
+
* BYMINUTE, BYSECOND, and BYSETPOS deliberately remain outside this helper;
|
|
396
|
+
* callers consume the date x time product incrementally.
|
|
363
397
|
*/
|
|
364
|
-
private
|
|
365
|
-
private
|
|
398
|
+
private generateYearlyDateCandidates;
|
|
399
|
+
private addByDayDates;
|
|
366
400
|
/**
|
|
367
401
|
* Helper to find the next valid value from a sorted array
|
|
368
402
|
*/
|
|
@@ -377,7 +411,7 @@ declare class RRuleTemporal<TOutput extends TemporalZonedDateTimeInput = Tempora
|
|
|
377
411
|
/**
|
|
378
412
|
* Generate occurrences for a specific week number in a given year
|
|
379
413
|
*/
|
|
380
|
-
private
|
|
414
|
+
private generateDateCandidatesForWeekInYear;
|
|
381
415
|
private getRscaleCalendarId;
|
|
382
416
|
private assertRscaleCalendarSupported;
|
|
383
417
|
private pad2;
|
package/dist/index.d.ts
CHANGED
|
@@ -14,8 +14,10 @@ interface BaseOpts<TOutput extends TemporalZonedDateTimeInput = TemporalZonedDat
|
|
|
14
14
|
temporal?: TemporalImplementation<TOutput>;
|
|
15
15
|
/** Time zone identifier as defined in RFC 5545 §3.2.19. */
|
|
16
16
|
tzid?: string;
|
|
17
|
-
/** Safety cap
|
|
17
|
+
/** Safety cap for advancing outer recurrence periods. */
|
|
18
18
|
maxIterations?: number;
|
|
19
|
+
/** Safety cap for candidate datetimes evaluated inside recurrence periods. */
|
|
20
|
+
maxCandidateEvaluations?: number;
|
|
19
21
|
/** Include DTSTART as an occurrence even if it does not match the rule pattern. */
|
|
20
22
|
includeDtstart?: boolean;
|
|
21
23
|
/** Enforce RFC 5545 constraints strictly (defaults to false). */
|
|
@@ -113,6 +115,7 @@ declare class RRuleTemporal<TOutput extends TemporalZonedDateTimeInput = Tempora
|
|
|
113
115
|
private readonly opts;
|
|
114
116
|
private readonly outputTemporal?;
|
|
115
117
|
private readonly maxIterations;
|
|
118
|
+
private readonly maxCandidateEvaluations;
|
|
116
119
|
private readonly includeDtstart;
|
|
117
120
|
private readonly parsedByDayTokens?;
|
|
118
121
|
private readonly simpleByDayIsoDays?;
|
|
@@ -149,6 +152,29 @@ declare class RRuleTemporal<TOutput extends TemporalZonedDateTimeInput = Tempora
|
|
|
149
152
|
* present the original date is returned unchanged.
|
|
150
153
|
*/
|
|
151
154
|
private expandByTime;
|
|
155
|
+
private localDateKey;
|
|
156
|
+
private sortedUniqueDateCandidates;
|
|
157
|
+
private timeOfDayNanoseconds;
|
|
158
|
+
private timeSlotNanoseconds;
|
|
159
|
+
/**
|
|
160
|
+
* `ZonedDateTime.with()` can reorder or alias wall-clock slots on a day with
|
|
161
|
+
* an offset transition (notably when a spring-forward gap is resolved). On
|
|
162
|
+
* those uncommon dates we retain the legacy sort semantics with a bounded
|
|
163
|
+
* one-day fallback instead of ever materializing a whole recurrence period.
|
|
164
|
+
*/
|
|
165
|
+
private needsSortedTimeFallback;
|
|
166
|
+
private createCandidateWorkBudget;
|
|
167
|
+
private recordCandidateEvaluation;
|
|
168
|
+
/**
|
|
169
|
+
* Visit BYHOUR x BYMINUTE x BYSECOND without allocating the Cartesian
|
|
170
|
+
* product. Returning false from `visit` terminates the innermost traversal
|
|
171
|
+
* immediately. The optional bounds are only supplied for the same local
|
|
172
|
+
* calendar date by `visitDateTimeCandidates`.
|
|
173
|
+
*/
|
|
174
|
+
private visitTimeSlots;
|
|
175
|
+
private visitDateTimeCandidates;
|
|
176
|
+
/** Apply BYSETPOS with bounded forward/reverse passes over one period. */
|
|
177
|
+
private visitPeriodCandidates;
|
|
152
178
|
private nextCandidateSameDate;
|
|
153
179
|
private applyTimeOverride;
|
|
154
180
|
private computeFirst;
|
|
@@ -163,6 +189,12 @@ declare class RRuleTemporal<TOutput extends TemporalZonedDateTimeInput = Tempora
|
|
|
163
189
|
private matchesByYearDay;
|
|
164
190
|
private getIsoWeekInfo;
|
|
165
191
|
private matchesByWeekNo;
|
|
192
|
+
/**
|
|
193
|
+
* Gregorian weekday and leap-year patterns repeat every 400 years. Checking
|
|
194
|
+
* a complete cycle lets impossible BYYEARDAY + BYWEEKNO intersections stop
|
|
195
|
+
* without incorrectly judging the rule from DTSTART's year alone.
|
|
196
|
+
*/
|
|
197
|
+
private hasPossibleYearDayWeekNoCombination;
|
|
166
198
|
options(): RRuleResolvedOptions<TOutput>;
|
|
167
199
|
private cloneOptions;
|
|
168
200
|
private cloneUpdateOptions;
|
|
@@ -203,7 +235,6 @@ declare class RRuleTemporal<TOutput extends TemporalZonedDateTimeInput = Tempora
|
|
|
203
235
|
private buildMonthlyOccurrenceOnDay;
|
|
204
236
|
private applyBySetPosToSortedList;
|
|
205
237
|
private generateMonthlyOccurrenceDays;
|
|
206
|
-
private generateMonthlyOccurrencesOptimizedBySetPos;
|
|
207
238
|
private isGregorianLeapYear;
|
|
208
239
|
private daysInGregorianMonth;
|
|
209
240
|
private gregorianIsoDayOfWeek;
|
|
@@ -231,6 +262,8 @@ declare class RRuleTemporal<TOutput extends TemporalZonedDateTimeInput = Tempora
|
|
|
231
262
|
private _allTzWeeklyExpanded;
|
|
232
263
|
private _allTzMonthlyByDayOrMonthDay;
|
|
233
264
|
private processOccurrences;
|
|
265
|
+
/** Process one occurrence and report whether generation should continue. */
|
|
266
|
+
private processOccurrence;
|
|
234
267
|
/**
|
|
235
268
|
* Returns all occurrences of the rule.
|
|
236
269
|
* @param iterator - An optional callback iterator function that can be used to filter or modify the occurrences.
|
|
@@ -352,17 +385,18 @@ declare class RRuleTemporal<TOutput extends TemporalZonedDateTimeInput = Tempora
|
|
|
352
385
|
private formatIcsDateTime;
|
|
353
386
|
private joinDates;
|
|
354
387
|
/**
|
|
355
|
-
*
|
|
356
|
-
*
|
|
388
|
+
* Resolve the calendar dates selected within a month without expanding any
|
|
389
|
+
* time BY-parts. This keeps the intermediate set bounded to calendar scale.
|
|
357
390
|
*/
|
|
391
|
+
private generateMonthlyDateCandidates;
|
|
358
392
|
private generateMonthlyOccurrences;
|
|
359
393
|
/**
|
|
360
|
-
*
|
|
361
|
-
*
|
|
362
|
-
*
|
|
394
|
+
* Resolve one recurrence year's matching calendar dates. BYHOUR,
|
|
395
|
+
* BYMINUTE, BYSECOND, and BYSETPOS deliberately remain outside this helper;
|
|
396
|
+
* callers consume the date x time product incrementally.
|
|
363
397
|
*/
|
|
364
|
-
private
|
|
365
|
-
private
|
|
398
|
+
private generateYearlyDateCandidates;
|
|
399
|
+
private addByDayDates;
|
|
366
400
|
/**
|
|
367
401
|
* Helper to find the next valid value from a sorted array
|
|
368
402
|
*/
|
|
@@ -377,7 +411,7 @@ declare class RRuleTemporal<TOutput extends TemporalZonedDateTimeInput = Tempora
|
|
|
377
411
|
/**
|
|
378
412
|
* Generate occurrences for a specific week number in a given year
|
|
379
413
|
*/
|
|
380
|
-
private
|
|
414
|
+
private generateDateCandidatesForWeekInYear;
|
|
381
415
|
private getRscaleCalendarId;
|
|
382
416
|
private assertRscaleCalendarSupported;
|
|
383
417
|
private pad2;
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as weekdayToIsoDay, n as allowedFreq, r as allowedWeekdays, t as RRuleTemporal } from "./src-
|
|
1
|
+
import { i as weekdayToIsoDay, n as allowedFreq, r as allowedWeekdays, t as RRuleTemporal } from "./src-B2XO5sNr.js";
|
|
2
2
|
export { RRuleTemporal, allowedFreq, allowedWeekdays, weekdayToIsoDay };
|