@hebcal/core 6.5.1 → 6.5.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/dist/bundle.js +5929 -5384
- package/dist/bundle.js.map +1 -1
- package/dist/bundle.min.js +17 -17
- package/dist/bundle.min.js.map +1 -1
- package/dist/esm/CalOptions.d.ts +3 -4
- package/dist/esm/DailyLearning.d.ts +44 -7
- package/dist/esm/DailyLearning.js +45 -8
- package/dist/esm/DailyLearning.js.map +1 -1
- package/dist/esm/HebrewDateEvent.js +1 -1
- package/dist/esm/HolidayEvent.d.ts +34 -1
- package/dist/esm/HolidayEvent.js +35 -2
- package/dist/esm/HolidayEvent.js.map +1 -1
- package/dist/esm/MevarchimChodeshEvent.js +1 -1
- package/dist/esm/ParshaEvent.js +1 -1
- package/dist/esm/TimedEvent.d.ts +32 -3
- package/dist/esm/TimedEvent.js +33 -4
- package/dist/esm/TimedEvent.js.map +1 -1
- package/dist/esm/YomKippurKatanEvent.js +1 -1
- package/dist/esm/ashkenazi.po.js +1 -1
- package/dist/esm/calendar.js +1 -1
- package/dist/esm/candles.d.ts +14 -1
- package/dist/esm/candles.js +15 -2
- package/dist/esm/candles.js.map +1 -1
- package/dist/esm/cities.json.js +1 -1
- package/dist/esm/event.d.ts +56 -13
- package/dist/esm/event.js +57 -14
- package/dist/esm/event.js.map +1 -1
- package/dist/esm/getStartAndEnd.js +10 -2
- package/dist/esm/getStartAndEnd.js.map +1 -1
- package/dist/esm/hallel.js +20 -28
- package/dist/esm/hallel.js.map +1 -1
- package/dist/esm/he-x-NoNikud.po.js +1 -1
- package/dist/esm/he.po.js +1 -1
- package/dist/esm/hebcal.d.ts +97 -19
- package/dist/esm/hebcal.js +102 -21
- package/dist/esm/hebcal.js.map +1 -1
- package/dist/esm/holidays.d.ts +21 -2
- package/dist/esm/holidays.js +22 -3
- package/dist/esm/holidays.js.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/isAssurBemlacha.d.ts +24 -4
- package/dist/esm/isAssurBemlacha.js +25 -5
- package/dist/esm/isAssurBemlacha.js.map +1 -1
- package/dist/esm/isAveilut.d.ts +14 -3
- package/dist/esm/isAveilut.js +15 -4
- package/dist/esm/isAveilut.js.map +1 -1
- package/dist/esm/isFastDay.d.ts +13 -1
- package/dist/esm/isFastDay.js +14 -2
- package/dist/esm/isFastDay.js.map +1 -1
- package/dist/esm/locale.js +1 -1
- package/dist/esm/location.d.ts +96 -8
- package/dist/esm/location.js +101 -10
- package/dist/esm/location.js.map +1 -1
- package/dist/esm/modern.js +1 -1
- package/dist/esm/molad.d.ts +39 -7
- package/dist/esm/molad.js +40 -8
- package/dist/esm/molad.js.map +1 -1
- package/dist/esm/moladBase.js +1 -1
- package/dist/esm/moladDate.js +1 -1
- package/dist/esm/omer.d.ts +32 -4
- package/dist/esm/omer.js +33 -5
- package/dist/esm/omer.js.map +1 -1
- package/dist/esm/parshaName.js +1 -1
- package/dist/esm/parshaYear.d.ts +12 -1
- package/dist/esm/parshaYear.js +13 -2
- package/dist/esm/parshaYear.js.map +1 -1
- package/dist/esm/pkgVersion.d.ts +1 -1
- package/dist/esm/pkgVersion.js +2 -2
- package/dist/esm/pkgVersion.js.map +1 -1
- package/dist/esm/reformatTimeStr.js +1 -1
- package/dist/esm/sedra.d.ts +94 -14
- package/dist/esm/sedra.js +95 -15
- package/dist/esm/sedra.js.map +1 -1
- package/dist/esm/sefira.json.js +1 -1
- package/dist/esm/staticHolidays.js +1 -1
- package/dist/esm/tachanun.js +1 -1
- package/dist/esm/temporal-shim.js +1 -1
- package/dist/esm/zmanim.js +1 -1
- package/dist/src/CalOptions.d.ts +3 -4
- package/dist/src/DailyLearning.d.ts +44 -7
- package/dist/src/DailyLearning.js +44 -7
- package/dist/src/HolidayEvent.d.ts +34 -1
- package/dist/src/HolidayEvent.js +34 -1
- package/dist/src/TimedEvent.d.ts +32 -3
- package/dist/src/TimedEvent.js +32 -3
- package/dist/src/candles.d.ts +14 -1
- package/dist/src/candles.js +14 -1
- package/dist/src/event.d.ts +56 -13
- package/dist/src/event.js +56 -13
- package/dist/src/getStartAndEnd.js +9 -1
- package/dist/src/hallel.js +19 -27
- package/dist/src/hebcal.d.ts +97 -19
- package/dist/src/hebcal.js +101 -20
- package/dist/src/holidays.d.ts +21 -2
- package/dist/src/holidays.js +21 -2
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/isAssurBemlacha.d.ts +24 -4
- package/dist/src/isAssurBemlacha.js +24 -4
- package/dist/src/isAveilut.d.ts +14 -3
- package/dist/src/isAveilut.js +14 -3
- package/dist/src/isFastDay.d.ts +13 -1
- package/dist/src/isFastDay.js +13 -1
- package/dist/src/location.d.ts +96 -8
- package/dist/src/location.js +100 -9
- package/dist/src/molad.d.ts +39 -7
- package/dist/src/molad.js +39 -7
- package/dist/src/omer.d.ts +32 -4
- package/dist/src/omer.js +32 -4
- package/dist/src/parshaYear.d.ts +12 -1
- package/dist/src/parshaYear.js +12 -1
- package/dist/src/pkgVersion.d.ts +1 -1
- package/dist/src/pkgVersion.js +1 -1
- package/dist/src/sedra.d.ts +94 -14
- package/dist/src/sedra.js +94 -14
- package/package.json +5 -5
package/dist/src/sedra.js
CHANGED
|
@@ -49,7 +49,23 @@ function yearType(hyear) {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
|
-
* Represents
|
|
52
|
+
* Represents the weekly Torah-reading (Parashat HaShavua) schedule for an
|
|
53
|
+
* entire Hebrew year.
|
|
54
|
+
*
|
|
55
|
+
* The schedule depends on the year's *keviyah* — the day of week of Rosh
|
|
56
|
+
* Hashana, whether the year is leap, whether Cheshvan/Kislev are long or
|
|
57
|
+
* short, and whether the schedule is for Israel or the Diaspora (since
|
|
58
|
+
* Israel and the Diaspora diverge in some years when the 8th day of Pesach
|
|
59
|
+
* or the 2nd day of Shavuot fall on Shabbat).
|
|
60
|
+
*
|
|
61
|
+
* Prefer {@link getSedra} (or {@link HebrewCalendar.getSedra}) over
|
|
62
|
+
* calling this constructor directly, since both cache their results.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* import {Sedra, HDate, months} from '@hebcal/core';
|
|
66
|
+
* const sedra = new Sedra(5784, false);
|
|
67
|
+
* const result = sedra.lookup(new HDate(15, months.CHESHVAN, 5784));
|
|
68
|
+
* console.log(result.parsha); // ['Lech-Lecha']
|
|
53
69
|
*/
|
|
54
70
|
export class Sedra {
|
|
55
71
|
year;
|
|
@@ -59,7 +75,7 @@ export class Sedra {
|
|
|
59
75
|
theSedraArray;
|
|
60
76
|
yearKey;
|
|
61
77
|
/**
|
|
62
|
-
*
|
|
78
|
+
* Calculates the Parashat HaShavua schedule for an entire Hebrew year.
|
|
63
79
|
* @param hyear - Hebrew year (e.g. 5749)
|
|
64
80
|
* @param il - Use Israel sedra schedule (false for Diaspora)
|
|
65
81
|
*/
|
|
@@ -89,8 +105,23 @@ export class Sedra {
|
|
|
89
105
|
}
|
|
90
106
|
}
|
|
91
107
|
/**
|
|
92
|
-
* Returns the date
|
|
93
|
-
*
|
|
108
|
+
* Returns the date a parsha is read this year, or `null` if it does not
|
|
109
|
+
* occur in this year's schedule.
|
|
110
|
+
*
|
|
111
|
+
* A doubled parsha (e.g. `'Matot-Masei'`) will only return a date in years
|
|
112
|
+
* where that pair is actually read together; in years where they are read
|
|
113
|
+
* separately, this returns `null`. Use {@link findContaining} to find the
|
|
114
|
+
* date a parsha is read regardless of whether it is doubled.
|
|
115
|
+
*
|
|
116
|
+
* Throws `RangeError` for an out-of-range numeric input or an invalid
|
|
117
|
+
* doubled-parsha pair, and `TypeError` for a malformed array argument.
|
|
118
|
+
* @example
|
|
119
|
+
* import {Sedra} from '@hebcal/core';
|
|
120
|
+
* const sedra = new Sedra(5784, false);
|
|
121
|
+
* sedra.find('Noach')?.toString(); // '15 Cheshvan 5784'
|
|
122
|
+
* sedra.find(1)?.toString(); // same, by 0-based index
|
|
123
|
+
* sedra.find('Matot-Masei')?.toString(); // null in 5784 — read separately
|
|
124
|
+
* sedra.find(['Matot', 'Masei']); // also null in 5784
|
|
94
125
|
* @param parsha if a `string`, specified with Sephardic transliterations
|
|
95
126
|
* like `'Noach'` or `'Matot-Masei'`. If an array, must be a 1- or 2-element
|
|
96
127
|
* array such as `['Noach']` or `['Matot', 'Masei']`. If a `number`, should
|
|
@@ -150,8 +181,22 @@ export class Sedra {
|
|
|
150
181
|
return new HDate(this.firstSaturday + idx * 7);
|
|
151
182
|
}
|
|
152
183
|
/**
|
|
153
|
-
* Returns the date
|
|
154
|
-
*
|
|
184
|
+
* Returns the date a parsha is read this year, looking through both
|
|
185
|
+
* single and doubled forms.
|
|
186
|
+
*
|
|
187
|
+
* For example, if `'Matot'` is read individually this year, this returns
|
|
188
|
+
* its date; if it is read as part of `'Matot-Masei'` this year, this
|
|
189
|
+
* returns the date of `'Matot-Masei'` (and similarly for `'Masei'`).
|
|
190
|
+
* Conversely, asking for `'Matot-Masei'` in a year where they are split
|
|
191
|
+
* will return the date of `'Matot'` alone.
|
|
192
|
+
* @example
|
|
193
|
+
* import {Sedra} from '@hebcal/core';
|
|
194
|
+
* const sedra = new Sedra(5784, false);
|
|
195
|
+
* // Matot-Masei is split in 5784; both individual halves resolve:
|
|
196
|
+
* sedra.findContaining('Matot')?.toString(); // '22 Tamuz 5784'
|
|
197
|
+
* sedra.findContaining('Masei')?.toString(); // '29 Tamuz 5784'
|
|
198
|
+
* // Asking for the doubled name returns the date of the first half:
|
|
199
|
+
* sedra.findContaining('Matot-Masei')?.toString(); // '22 Tamuz 5784'
|
|
155
200
|
*/
|
|
156
201
|
findContaining(parsha) {
|
|
157
202
|
const hdate = this.find(parsha);
|
|
@@ -194,23 +239,50 @@ export class Sedra {
|
|
|
194
239
|
}
|
|
195
240
|
}
|
|
196
241
|
/**
|
|
197
|
-
* Returns the underlying annual
|
|
198
|
-
*
|
|
242
|
+
* Returns the underlying annual reading schedule as an array, where each
|
|
243
|
+
* entry corresponds to one Saturday (starting from the first Shabbat on
|
|
244
|
+
* or after Rosh Hashana). Entries are either:
|
|
245
|
+
* - a non-negative `number`: a 0-based parsha index (e.g. `0` for
|
|
246
|
+
* *Bereshit*)
|
|
247
|
+
* - a negative `number`: the negated first index of a doubled parsha
|
|
248
|
+
* (e.g. `-21` for *Vayakhel-Pekudei*)
|
|
249
|
+
* - a `string`: a holiday name when a Yom Tov displaces the weekly reading
|
|
250
|
+
* (e.g. `'Pesach Shabbat Chol ha-Moed'`, `'Yom Kippur'`)
|
|
251
|
+
*
|
|
252
|
+
* Used by `@hebcal/triennial`.
|
|
199
253
|
*/
|
|
200
254
|
getSedraArray() {
|
|
201
255
|
return this.theSedraArray;
|
|
202
256
|
}
|
|
203
257
|
/**
|
|
204
|
-
* R.D.
|
|
258
|
+
* Returns the R.D. (Rata Die / Fixed Date) absolute day number of the
|
|
259
|
+
* first Saturday on or after Rosh Hashana of this year. This is the
|
|
260
|
+
* anchor point for {@link getSedraArray} — index `0` of that array
|
|
261
|
+
* corresponds to this date.
|
|
205
262
|
*/
|
|
206
263
|
getFirstSaturday() {
|
|
207
264
|
return this.firstSaturday;
|
|
208
265
|
}
|
|
266
|
+
/** Returns the Hebrew year this `Sedra` instance covers. */
|
|
209
267
|
getYear() {
|
|
210
268
|
return this.year;
|
|
211
269
|
}
|
|
212
270
|
/**
|
|
213
|
-
* Returns
|
|
271
|
+
* Returns details about the parsha read on the first Saturday on or after
|
|
272
|
+
* `hd`. If `hd` is itself a Saturday, the reading for that date is
|
|
273
|
+
* returned; otherwise the reading for the upcoming Saturday is returned.
|
|
274
|
+
*
|
|
275
|
+
* If the given date falls in the final days of the Hebrew year (after
|
|
276
|
+
* the last reading of this year's schedule), this method transparently
|
|
277
|
+
* delegates to the next year's `Sedra`.
|
|
278
|
+
* @example
|
|
279
|
+
* import {Sedra, HDate, months} from '@hebcal/core';
|
|
280
|
+
* const sedra = new Sedra(5784, false);
|
|
281
|
+
* // A weekday — returns the upcoming Shabbat's reading
|
|
282
|
+
* const result = sedra.lookup(new HDate(13, months.CHESHVAN, 5784));
|
|
283
|
+
* console.log(result.parsha); // ['Lech-Lecha']
|
|
284
|
+
* console.log(result.chag); // false
|
|
285
|
+
* console.log(result.hdate.toString()); // '15 Cheshvan 5784' (Saturday)
|
|
214
286
|
* @param hd Hebrew date or R.D. days
|
|
215
287
|
*/
|
|
216
288
|
lookup(hd) {
|
|
@@ -467,10 +539,18 @@ types['1311'] = types['1221'];
|
|
|
467
539
|
types['1721'] = types['170'];
|
|
468
540
|
const sedraCache = new QuickLRU({ maxSize: 120 });
|
|
469
541
|
/**
|
|
470
|
-
* Convenience function to create an instance of
|
|
471
|
-
* created and cached instance.
|
|
472
|
-
*
|
|
473
|
-
*
|
|
542
|
+
* Convenience function to create an instance of {@link Sedra} or reuse a
|
|
543
|
+
* previously created and cached instance for the same year and schedule.
|
|
544
|
+
*
|
|
545
|
+
* Prefer this over `new Sedra(...)` when calling repeatedly — an internal
|
|
546
|
+
* LRU cache (~120 entries) avoids recomputing the keviyah-specific schedule.
|
|
547
|
+
* @example
|
|
548
|
+
* import {getSedra, HDate, months} from '@hebcal/core';
|
|
549
|
+
* const sedra = getSedra(5784, false);
|
|
550
|
+
* const {parsha} = sedra.lookup(new HDate(15, months.CHESHVAN, 5784));
|
|
551
|
+
* console.log(parsha); // ['Lech-Lecha']
|
|
552
|
+
* @param hyear Hebrew year
|
|
553
|
+
* @param il Use Israel sedra schedule (`false` for Diaspora)
|
|
474
554
|
*/
|
|
475
555
|
export function getSedra(hyear, il) {
|
|
476
556
|
const cacheKey = `${hyear}-${il ? 1 : 0}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hebcal/core",
|
|
3
|
-
"version": "6.5.
|
|
3
|
+
"version": "6.5.2",
|
|
4
4
|
"author": "Michael J. Radwin (https://github.com/mjradwin)",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Eyal Schachter (https://github.com/Scimonster)",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
73
73
|
"@rollup/plugin-terser": "^1.0.0",
|
|
74
74
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
75
|
-
"@types/node": "^25.
|
|
76
|
-
"@vitest/coverage-v8": "^4.1.
|
|
75
|
+
"@types/node": "^25.9.1",
|
|
76
|
+
"@vitest/coverage-v8": "^4.1.7",
|
|
77
77
|
"gettext-parser": "^9.0.2",
|
|
78
78
|
"gts": "^7.0.0",
|
|
79
79
|
"pretty-bytes": "^7.1.0",
|
|
@@ -82,10 +82,10 @@
|
|
|
82
82
|
"rollup-plugin-visualizer": "^7.0.1",
|
|
83
83
|
"typedoc": "^0.28.19",
|
|
84
84
|
"typescript": "^6.0.3",
|
|
85
|
-
"vitest": "^4.1.
|
|
85
|
+
"vitest": "^4.1.7"
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"@hebcal/hdate": "^0.22.
|
|
88
|
+
"@hebcal/hdate": "^0.22.3",
|
|
89
89
|
"@hebcal/noaa": "^0.11.0",
|
|
90
90
|
"quick-lru": "^7.3.0",
|
|
91
91
|
"temporal-polyfill": "^0.3.2"
|