@hebcal/core 5.4.4 → 5.4.6

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.
@@ -5,9 +5,9 @@ import './locale';
5
5
  * Represents one of 54 weekly Torah portions, always on a Saturday
6
6
  */
7
7
  export declare class ParshaEvent extends Event {
8
- private readonly parsha;
9
- private readonly il;
10
- private readonly num;
8
+ readonly parsha: string[];
9
+ readonly il: boolean;
10
+ readonly num: number | number[];
11
11
  /**
12
12
  * @param {HDate} date
13
13
  * @param {string[]} parsha - untranslated name of single or double parsha,
package/dist/bundle.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v5.4.4 */
1
+ /*! @hebcal/core v5.4.6 */
2
2
  var hebcal = (function (exports) {
3
3
  'use strict';
4
4
 
@@ -9889,9 +9889,17 @@ class HavdalahEvent extends TimedEvent {
9889
9889
  const shortDayNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
9890
9890
  const heDayNames = ['רִאשׁוֹן', 'שֵׁנִי', 'שְׁלִישִׁי', 'רְבִיעִי', 'חֲמִישִׁי', 'שִׁישִּׁי', 'שַׁבָּת'];
9891
9891
  const night = 'בַּלַּ֥יְלָה';
9892
- const morning = 'בַּבֹּקֶר';
9893
- const afternoon = 'בַּצׇּהֳרַיִים';
9894
- const evening = 'בָּעֶרֶב';
9892
+ function getHebrewTimeOfDay(hour) {
9893
+ if (hour < 5)
9894
+ return night;
9895
+ else if (hour < 12)
9896
+ return 'בַּבֹּקֶר';
9897
+ else if (hour < 17)
9898
+ return 'בַּצׇּהֳרַיִים';
9899
+ else if (hour < 21)
9900
+ return 'בָּעֶרֶב';
9901
+ return night;
9902
+ }
9895
9903
  /**
9896
9904
  * Represents a molad, the moment when the new moon is "born"
9897
9905
  */
@@ -9952,6 +9960,7 @@ class Molad {
9952
9960
  * @return {string}
9953
9961
  */
9954
9962
  render(locale, options) {
9963
+ var _a;
9955
9964
  locale = locale !== null && locale !== void 0 ? locale : Locale.getLocaleName();
9956
9965
  if (typeof locale === 'string') {
9957
9966
  locale = locale.toLowerCase();
@@ -9964,11 +9973,10 @@ class Molad {
9964
9973
  const hour = this.getHour();
9965
9974
  const chalakim = this.getChalakim();
9966
9975
  const moladStr = Locale.gettext('Molad', locale);
9967
- const minutesStr = Locale.lookupTranslation('min', locale) || 'minutes';
9976
+ const minutesStr = (_a = Locale.lookupTranslation('min', locale)) !== null && _a !== void 0 ? _a : 'minutes';
9968
9977
  const chalakimStr = Locale.gettext('chalakim', locale);
9969
9978
  if (isHebrewLocale) {
9970
- const ampm = hour < 5 ? night : hour < 12 ? morning :
9971
- hour < 17 ? afternoon : hour < 21 ? evening : night;
9979
+ const ampm = getHebrewTimeOfDay(hour);
9972
9980
  const result = `${moladStr} ${monthName} יִהְיֶה בַּיּוֹם ${dow} בשָׁבוּעַ, ` +
9973
9981
  `בְּשָׁעָה ${hour} ${ampm}, ` +
9974
9982
  `ו-${minutes} ${minutesStr} ` +
@@ -10093,12 +10101,6 @@ class OmerEvent extends Event {
10093
10101
  }
10094
10102
 
10095
10103
  class QuickLRU extends Map {
10096
- #size = 0;
10097
- #cache = new Map();
10098
- #oldCache = new Map();
10099
- #maxSize;
10100
- #maxAge;
10101
- #onEviction;
10102
10104
  constructor() {
10103
10105
  let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
10104
10106
  super();
@@ -10108,102 +10110,104 @@ class QuickLRU extends Map {
10108
10110
  if (typeof options.maxAge === 'number' && options.maxAge === 0) {
10109
10111
  throw new TypeError('`maxAge` must be a number greater than 0');
10110
10112
  }
10111
- this.#maxSize = options.maxSize;
10112
- this.#maxAge = options.maxAge || Number.POSITIVE_INFINITY;
10113
- this.#onEviction = options.onEviction;
10114
- }
10115
10113
 
10116
- // For tests.
10117
- get __oldCache() {
10118
- return this.#oldCache;
10114
+ // TODO: Use private class fields when ESLint supports them.
10115
+ this.maxSize = options.maxSize;
10116
+ this.maxAge = options.maxAge || Number.POSITIVE_INFINITY;
10117
+ this.onEviction = options.onEviction;
10118
+ this.cache = new Map();
10119
+ this.oldCache = new Map();
10120
+ this._size = 0;
10119
10121
  }
10120
- #emitEvictions(cache) {
10121
- if (typeof this.#onEviction !== 'function') {
10122
+
10123
+ // TODO: Use private class methods when targeting Node.js 16.
10124
+ _emitEvictions(cache) {
10125
+ if (typeof this.onEviction !== 'function') {
10122
10126
  return;
10123
10127
  }
10124
10128
  for (const [key, item] of cache) {
10125
- this.#onEviction(key, item.value);
10129
+ this.onEviction(key, item.value);
10126
10130
  }
10127
10131
  }
10128
- #deleteIfExpired(key, item) {
10132
+ _deleteIfExpired(key, item) {
10129
10133
  if (typeof item.expiry === 'number' && item.expiry <= Date.now()) {
10130
- if (typeof this.#onEviction === 'function') {
10131
- this.#onEviction(key, item.value);
10134
+ if (typeof this.onEviction === 'function') {
10135
+ this.onEviction(key, item.value);
10132
10136
  }
10133
10137
  return this.delete(key);
10134
10138
  }
10135
10139
  return false;
10136
10140
  }
10137
- #getOrDeleteIfExpired(key, item) {
10138
- const deleted = this.#deleteIfExpired(key, item);
10141
+ _getOrDeleteIfExpired(key, item) {
10142
+ const deleted = this._deleteIfExpired(key, item);
10139
10143
  if (deleted === false) {
10140
10144
  return item.value;
10141
10145
  }
10142
10146
  }
10143
- #getItemValue(key, item) {
10144
- return item.expiry ? this.#getOrDeleteIfExpired(key, item) : item.value;
10147
+ _getItemValue(key, item) {
10148
+ return item.expiry ? this._getOrDeleteIfExpired(key, item) : item.value;
10145
10149
  }
10146
- #peek(key, cache) {
10150
+ _peek(key, cache) {
10147
10151
  const item = cache.get(key);
10148
- return this.#getItemValue(key, item);
10152
+ return this._getItemValue(key, item);
10149
10153
  }
10150
- #set(key, value) {
10151
- this.#cache.set(key, value);
10152
- this.#size++;
10153
- if (this.#size >= this.#maxSize) {
10154
- this.#size = 0;
10155
- this.#emitEvictions(this.#oldCache);
10156
- this.#oldCache = this.#cache;
10157
- this.#cache = new Map();
10154
+ _set(key, value) {
10155
+ this.cache.set(key, value);
10156
+ this._size++;
10157
+ if (this._size >= this.maxSize) {
10158
+ this._size = 0;
10159
+ this._emitEvictions(this.oldCache);
10160
+ this.oldCache = this.cache;
10161
+ this.cache = new Map();
10158
10162
  }
10159
10163
  }
10160
- #moveToRecent(key, item) {
10161
- this.#oldCache.delete(key);
10162
- this.#set(key, item);
10164
+ _moveToRecent(key, item) {
10165
+ this.oldCache.delete(key);
10166
+ this._set(key, item);
10163
10167
  }
10164
- *#entriesAscending() {
10165
- for (const item of this.#oldCache) {
10168
+ *_entriesAscending() {
10169
+ for (const item of this.oldCache) {
10166
10170
  const [key, value] = item;
10167
- if (!this.#cache.has(key)) {
10168
- const deleted = this.#deleteIfExpired(key, value);
10171
+ if (!this.cache.has(key)) {
10172
+ const deleted = this._deleteIfExpired(key, value);
10169
10173
  if (deleted === false) {
10170
10174
  yield item;
10171
10175
  }
10172
10176
  }
10173
10177
  }
10174
- for (const item of this.#cache) {
10178
+ for (const item of this.cache) {
10175
10179
  const [key, value] = item;
10176
- const deleted = this.#deleteIfExpired(key, value);
10180
+ const deleted = this._deleteIfExpired(key, value);
10177
10181
  if (deleted === false) {
10178
10182
  yield item;
10179
10183
  }
10180
10184
  }
10181
10185
  }
10182
10186
  get(key) {
10183
- if (this.#cache.has(key)) {
10184
- const item = this.#cache.get(key);
10185
- return this.#getItemValue(key, item);
10186
- }
10187
- if (this.#oldCache.has(key)) {
10188
- const item = this.#oldCache.get(key);
10189
- if (this.#deleteIfExpired(key, item) === false) {
10190
- this.#moveToRecent(key, item);
10187
+ if (this.cache.has(key)) {
10188
+ const item = this.cache.get(key);
10189
+ return this._getItemValue(key, item);
10190
+ }
10191
+ if (this.oldCache.has(key)) {
10192
+ const item = this.oldCache.get(key);
10193
+ if (this._deleteIfExpired(key, item) === false) {
10194
+ this._moveToRecent(key, item);
10191
10195
  return item.value;
10192
10196
  }
10193
10197
  }
10194
10198
  }
10195
10199
  set(key, value) {
10196
10200
  let {
10197
- maxAge = this.#maxAge
10201
+ maxAge = this.maxAge
10198
10202
  } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
10199
10203
  const expiry = typeof maxAge === 'number' && maxAge !== Number.POSITIVE_INFINITY ? Date.now() + maxAge : undefined;
10200
- if (this.#cache.has(key)) {
10201
- this.#cache.set(key, {
10204
+ if (this.cache.has(key)) {
10205
+ this.cache.set(key, {
10202
10206
  value,
10203
10207
  expiry
10204
10208
  });
10205
10209
  } else {
10206
- this.#set(key, {
10210
+ this._set(key, {
10207
10211
  value,
10208
10212
  expiry
10209
10213
  });
@@ -10211,53 +10215,53 @@ class QuickLRU extends Map {
10211
10215
  return this;
10212
10216
  }
10213
10217
  has(key) {
10214
- if (this.#cache.has(key)) {
10215
- return !this.#deleteIfExpired(key, this.#cache.get(key));
10218
+ if (this.cache.has(key)) {
10219
+ return !this._deleteIfExpired(key, this.cache.get(key));
10216
10220
  }
10217
- if (this.#oldCache.has(key)) {
10218
- return !this.#deleteIfExpired(key, this.#oldCache.get(key));
10221
+ if (this.oldCache.has(key)) {
10222
+ return !this._deleteIfExpired(key, this.oldCache.get(key));
10219
10223
  }
10220
10224
  return false;
10221
10225
  }
10222
10226
  peek(key) {
10223
- if (this.#cache.has(key)) {
10224
- return this.#peek(key, this.#cache);
10227
+ if (this.cache.has(key)) {
10228
+ return this._peek(key, this.cache);
10225
10229
  }
10226
- if (this.#oldCache.has(key)) {
10227
- return this.#peek(key, this.#oldCache);
10230
+ if (this.oldCache.has(key)) {
10231
+ return this._peek(key, this.oldCache);
10228
10232
  }
10229
10233
  }
10230
10234
  delete(key) {
10231
- const deleted = this.#cache.delete(key);
10235
+ const deleted = this.cache.delete(key);
10232
10236
  if (deleted) {
10233
- this.#size--;
10237
+ this._size--;
10234
10238
  }
10235
- return this.#oldCache.delete(key) || deleted;
10239
+ return this.oldCache.delete(key) || deleted;
10236
10240
  }
10237
10241
  clear() {
10238
- this.#cache.clear();
10239
- this.#oldCache.clear();
10240
- this.#size = 0;
10242
+ this.cache.clear();
10243
+ this.oldCache.clear();
10244
+ this._size = 0;
10241
10245
  }
10242
10246
  resize(newSize) {
10243
10247
  if (!(newSize && newSize > 0)) {
10244
10248
  throw new TypeError('`maxSize` must be a number greater than 0');
10245
10249
  }
10246
- const items = [...this.#entriesAscending()];
10250
+ const items = [...this._entriesAscending()];
10247
10251
  const removeCount = items.length - newSize;
10248
10252
  if (removeCount < 0) {
10249
- this.#cache = new Map(items);
10250
- this.#oldCache = new Map();
10251
- this.#size = items.length;
10253
+ this.cache = new Map(items);
10254
+ this.oldCache = new Map();
10255
+ this._size = items.length;
10252
10256
  } else {
10253
10257
  if (removeCount > 0) {
10254
- this.#emitEvictions(items.slice(0, removeCount));
10258
+ this._emitEvictions(items.slice(0, removeCount));
10255
10259
  }
10256
- this.#oldCache = new Map(items.slice(removeCount));
10257
- this.#cache = new Map();
10258
- this.#size = 0;
10260
+ this.oldCache = new Map(items.slice(removeCount));
10261
+ this.cache = new Map();
10262
+ this._size = 0;
10259
10263
  }
10260
- this.#maxSize = newSize;
10264
+ this.maxSize = newSize;
10261
10265
  }
10262
10266
  *keys() {
10263
10267
  for (const [key] of this) {
@@ -10270,17 +10274,17 @@ class QuickLRU extends Map {
10270
10274
  }
10271
10275
  }
10272
10276
  *[Symbol.iterator]() {
10273
- for (const item of this.#cache) {
10277
+ for (const item of this.cache) {
10274
10278
  const [key, value] = item;
10275
- const deleted = this.#deleteIfExpired(key, value);
10279
+ const deleted = this._deleteIfExpired(key, value);
10276
10280
  if (deleted === false) {
10277
10281
  yield [key, value.value];
10278
10282
  }
10279
10283
  }
10280
- for (const item of this.#oldCache) {
10284
+ for (const item of this.oldCache) {
10281
10285
  const [key, value] = item;
10282
- if (!this.#cache.has(key)) {
10283
- const deleted = this.#deleteIfExpired(key, value);
10286
+ if (!this.cache.has(key)) {
10287
+ const deleted = this._deleteIfExpired(key, value);
10284
10288
  if (deleted === false) {
10285
10289
  yield [key, value.value];
10286
10290
  }
@@ -10288,21 +10292,21 @@ class QuickLRU extends Map {
10288
10292
  }
10289
10293
  }
10290
10294
  *entriesDescending() {
10291
- let items = [...this.#cache];
10295
+ let items = [...this.cache];
10292
10296
  for (let i = items.length - 1; i >= 0; --i) {
10293
10297
  const item = items[i];
10294
10298
  const [key, value] = item;
10295
- const deleted = this.#deleteIfExpired(key, value);
10299
+ const deleted = this._deleteIfExpired(key, value);
10296
10300
  if (deleted === false) {
10297
10301
  yield [key, value.value];
10298
10302
  }
10299
10303
  }
10300
- items = [...this.#oldCache];
10304
+ items = [...this.oldCache];
10301
10305
  for (let i = items.length - 1; i >= 0; --i) {
10302
10306
  const item = items[i];
10303
10307
  const [key, value] = item;
10304
- if (!this.#cache.has(key)) {
10305
- const deleted = this.#deleteIfExpired(key, value);
10308
+ if (!this.cache.has(key)) {
10309
+ const deleted = this._deleteIfExpired(key, value);
10306
10310
  if (deleted === false) {
10307
10311
  yield [key, value.value];
10308
10312
  }
@@ -10310,24 +10314,21 @@ class QuickLRU extends Map {
10310
10314
  }
10311
10315
  }
10312
10316
  *entriesAscending() {
10313
- for (const [key, value] of this.#entriesAscending()) {
10317
+ for (const [key, value] of this._entriesAscending()) {
10314
10318
  yield [key, value.value];
10315
10319
  }
10316
10320
  }
10317
10321
  get size() {
10318
- if (!this.#size) {
10319
- return this.#oldCache.size;
10322
+ if (!this._size) {
10323
+ return this.oldCache.size;
10320
10324
  }
10321
10325
  let oldCacheSize = 0;
10322
- for (const key of this.#oldCache.keys()) {
10323
- if (!this.#cache.has(key)) {
10326
+ for (const key of this.oldCache.keys()) {
10327
+ if (!this.cache.has(key)) {
10324
10328
  oldCacheSize++;
10325
10329
  }
10326
10330
  }
10327
- return Math.min(this.#size + oldCacheSize, this.#maxSize);
10328
- }
10329
- get maxSize() {
10330
- return this.#maxSize;
10331
+ return Math.min(this._size + oldCacheSize, this.maxSize);
10331
10332
  }
10332
10333
  entries() {
10333
10334
  return this.entriesAscending();
@@ -10377,6 +10378,19 @@ class QuickLRU extends Map {
10377
10378
  const INCOMPLETE = 0;
10378
10379
  const REGULAR = 1;
10379
10380
  const COMPLETE = 2;
10381
+ function yearType(hyear) {
10382
+ const longC = HDate.longCheshvan(hyear);
10383
+ const shortK = HDate.shortKislev(hyear);
10384
+ if (longC && !shortK) {
10385
+ return COMPLETE;
10386
+ }
10387
+ else if (!longC && shortK) {
10388
+ return INCOMPLETE;
10389
+ }
10390
+ else {
10391
+ return REGULAR;
10392
+ }
10393
+ }
10380
10394
  /**
10381
10395
  * Represents Parashah HaShavua for an entire Hebrew year
10382
10396
  */
@@ -10388,11 +10402,6 @@ class Sedra {
10388
10402
  */
10389
10403
  constructor(hyear, il) {
10390
10404
  hyear = +hyear;
10391
- const longC = HDate.longCheshvan(hyear);
10392
- const shortK = HDate.shortKislev(hyear);
10393
- const type = (longC && !shortK) ? COMPLETE :
10394
- (!longC && shortK) ? INCOMPLETE :
10395
- REGULAR;
10396
10405
  this.year = hyear;
10397
10406
  const rh0 = new HDate(1, months.TISHREI, hyear);
10398
10407
  const rh = rh0.abs();
@@ -10401,6 +10410,7 @@ class Sedra {
10401
10410
  this.firstSaturday = HDate.dayOnOrBefore(6, rh + 6);
10402
10411
  const leap = +HDate.isLeapYear(hyear);
10403
10412
  this.il = Boolean(il);
10413
+ const type = yearType(hyear);
10404
10414
  let key = `${leap}${rhDay}${type}`;
10405
10415
  if (types[key]) {
10406
10416
  this.theSedraArray = types[key];
@@ -10653,7 +10663,6 @@ const YK = 'Yom Kippur'; // 1
10653
10663
  const SUKKOT = 'Sukkot'; // 0
10654
10664
  const CHMSUKOT = 'Sukkot Shabbat Chol ha-Moed'; // 0
10655
10665
  const SHMINI = 'Shmini Atzeret'; // 0
10656
- const EOY = CHMSUKOT; // always Sukkot day 3, 5 or 6
10657
10666
  const PESACH = 'Pesach'; // 25
10658
10667
  const PESACH1 = 'Pesach I';
10659
10668
  const CHMPESACH = 'Pesach Shabbat Chol ha-Moed'; // 25
@@ -10670,75 +10679,81 @@ const SHAVUOT$1 = 'Shavuot'; // 33
10670
10679
  function range$1(start, stop) {
10671
10680
  return Array.from({ length: stop - start + 1 }, (v, k) => k + start);
10672
10681
  }
10673
- const empty = [];
10682
+ const yearStartVayeilech = [51, 52, CHMSUKOT];
10683
+ const yearStartHaazinu = [52, YK, CHMSUKOT];
10684
+ const yearStartRH = [RH, 52, SUKKOT, SHMINI];
10685
+ const r020 = range$1(0, 20);
10686
+ const r027 = range$1(0, 27);
10687
+ const r3340 = range$1(33, 40);
10688
+ const r4349 = range$1(43, 49);
10689
+ const r4350 = range$1(43, 50);
10674
10690
  /**
10675
10691
  * The ordinary year types (keviot)
10676
10692
  * names are leap/nonleap - day - incomplete/regular/complete - diaspora/Israel
10677
10693
  * @private
10678
10694
  * @readonly
10679
- * @type {Object.<string, NumberOrString[]>}
10680
10695
  */
10681
10696
  const types = {
10682
10697
  /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and
10683
10698
  * Kislev each have 29 days), and has Passover start on Tuesday. */
10684
10699
  // e.g. 5753
10685
- '020': empty.concat(51, 52, EOY, range$1(0, 20), D(21), 23, 24, PESACH, 25, D(26), D(28), 30, D(31), range$1(33, 40), D(41), range$1(43, 49), D(50)),
10700
+ '020': yearStartVayeilech.concat(r020, D(21), 23, 24, PESACH, 25, D(26), D(28), 30, D(31), r3340, D(41), r4349, D(50)),
10686
10701
  /* Hebrew year that starts on Monday, is `complete' (Heshvan and
10687
10702
  * Kislev each have 30 days), and has Passover start on Thursday. */
10688
10703
  // e.g. 5756
10689
- '0220': empty.concat(51, 52, EOY, range$1(0, 20), D(21), 23, 24, PESACH, 25, D(26), D(28), 30, D(31), 33, SHAVUOT$1, range$1(34, 37), D(38), 40, D(41), range$1(43, 49), D(50)),
10704
+ '0220': yearStartVayeilech.concat(r020, D(21), 23, 24, PESACH, 25, D(26), D(28), 30, D(31), 33, SHAVUOT$1, range$1(34, 37), D(38), 40, D(41), r4349, D(50)),
10690
10705
  /* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29
10691
10706
  * days and Kislev has 30 days), and has Passover start on Saturday. */
10692
10707
  // e.g. 5701
10693
- '0510': empty.concat(52, YK, EOY, range$1(0, 20), D(21), 23, 24, PESACH1, PESACH8, 25, D(26), D(28), 30, D(31), range$1(33, 40), D(41), range$1(43, 50)),
10708
+ '0510': yearStartHaazinu.concat(r020, D(21), 23, 24, PESACH1, PESACH8, 25, D(26), D(28), 30, D(31), r3340, D(41), r4350),
10694
10709
  /* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29
10695
10710
  * days and Kislev has 30 days), and has Passover start on Saturday. */
10696
10711
  // e.g. 5745
10697
- '0511': empty.concat(52, YK, EOY, range$1(0, 20), D(21), 23, 24, PESACH, 25, D(26), D(28), range$1(30, 40), D(41), range$1(43, 50)),
10712
+ '0511': yearStartHaazinu.concat(r020, D(21), 23, 24, PESACH, 25, D(26), D(28), range$1(30, 40), D(41), r4350),
10698
10713
  /* Hebrew year that starts on Thursday, is `complete' (Heshvan and
10699
10714
  * Kislev each have 30 days), and has Passover start on Sunday. */
10700
10715
  // e.g. 5754
10701
- '052': empty.concat(52, YK, CHMSUKOT, range$1(0, 24), PESACH7, 25, D(26), D(28), 30, D(31), range$1(33, 40), D(41), range$1(43, 50)),
10716
+ '052': yearStartHaazinu.concat(range$1(0, 24), PESACH7, 25, D(26), D(28), 30, D(31), r3340, D(41), r4350),
10702
10717
  /* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and Kislev
10703
10718
  * each have 29 days), and has Passover start on Sunday. */
10704
10719
  // e.g. 5761
10705
- '070': empty.concat(RH, 52, SUKKOT, SHMINI, range$1(0, 20), D(21), 23, 24, PESACH7, 25, D(26), D(28), 30, D(31), range$1(33, 40), D(41), range$1(43, 50)),
10720
+ '070': yearStartRH.concat(r020, D(21), 23, 24, PESACH7, 25, D(26), D(28), 30, D(31), r3340, D(41), r4350),
10706
10721
  /* Hebrew year that starts on Saturday, is `complete' (Heshvan and
10707
10722
  * Kislev each have 30 days), and has Passover start on Tuesday. */
10708
10723
  // e.g. 5716
10709
- '072': empty.concat(RH, 52, SUKKOT, SHMINI, range$1(0, 20), D(21), 23, 24, CHMPESACH, 25, D(26), D(28), 30, D(31), range$1(33, 40), D(41), range$1(43, 49), D(50)),
10724
+ '072': yearStartRH.concat(r020, D(21), 23, 24, CHMPESACH, 25, D(26), D(28), 30, D(31), r3340, D(41), r4349, D(50)),
10710
10725
  /* -- The leap year types (keviot) -- */
10711
10726
  /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and
10712
10727
  * Kislev each have 29 days), and has Passover start on Thursday. */
10713
10728
  // e.g. 5746
10714
- '1200': empty.concat(51, 52, CHMSUKOT, range$1(0, 27), CHMPESACH, range$1(28, 33), SHAVUOT$1, range$1(34, 37), D(38), 40, D(41), range$1(43, 49), D(50)),
10729
+ '1200': yearStartVayeilech.concat(r027, CHMPESACH, range$1(28, 33), SHAVUOT$1, range$1(34, 37), D(38), 40, D(41), r4349, D(50)),
10715
10730
  /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and
10716
10731
  * Kislev each have 29 days), and has Passover start on Thursday. */
10717
10732
  // e.g. 5746
10718
- '1201': empty.concat(51, 52, CHMSUKOT, range$1(0, 27), CHMPESACH, range$1(28, 40), D(41), range$1(43, 49), D(50)),
10733
+ '1201': yearStartVayeilech.concat(r027, CHMPESACH, range$1(28, 40), D(41), r4349, D(50)),
10719
10734
  /* Hebrew year that starts on Monday, is `complete' (Heshvan and
10720
10735
  * Kislev each have 30 days), and has Passover start on Saturday. */
10721
10736
  // e.g.5752
10722
- '1220': empty.concat(51, 52, CHMSUKOT, range$1(0, 27), PESACH1, PESACH8, range$1(28, 40), D(41), range$1(43, 50)),
10737
+ '1220': yearStartVayeilech.concat(r027, PESACH1, PESACH8, range$1(28, 40), D(41), r4350),
10723
10738
  /* Hebrew year that starts on Monday, is `complete' (Heshvan and
10724
10739
  * Kislev each have 30 days), and has Passover start on Saturday. */
10725
10740
  // e.g.5752
10726
- '1221': empty.concat(51, 52, CHMSUKOT, range$1(0, 27), PESACH, range$1(28, 50)),
10741
+ '1221': yearStartVayeilech.concat(r027, PESACH, range$1(28, 50)),
10727
10742
  /* Hebrew year that starts on Thursday, is `incomplete' (Heshvan and
10728
10743
  * Kislev both have 29 days), and has Passover start on Sunday. */
10729
10744
  // e.g. 5768
10730
- '150': empty.concat(52, YK, CHMSUKOT, range$1(0, 28), PESACH7, range$1(29, 50)),
10745
+ '150': yearStartHaazinu.concat(range$1(0, 28), PESACH7, range$1(29, 50)),
10731
10746
  /* Hebrew year that starts on Thursday, is `complete' (Heshvan and
10732
10747
  * Kislev both have 30 days), and has Passover start on Tuesday. */
10733
10748
  // eg. 5771
10734
- '152': empty.concat(52, YK, CHMSUKOT, range$1(0, 28), CHMPESACH, range$1(29, 49), D(50)),
10749
+ '152': yearStartHaazinu.concat(range$1(0, 28), CHMPESACH, range$1(29, 49), D(50)),
10735
10750
  /* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and
10736
10751
  * Kislev each have 29 days), and has Passover start on Tuesday. */
10737
10752
  // e.g.5757
10738
- '170': empty.concat(RH, 52, SUKKOT, SHMINI, range$1(0, 27), CHMPESACH, range$1(28, 40), D(41), range$1(43, 49), D(50)),
10753
+ '170': yearStartRH.concat(r027, CHMPESACH, range$1(28, 40), D(41), r4349, D(50)),
10739
10754
  /* Hebrew year that starts on Saturday, is `complete' (Heshvan and
10740
10755
  * Kislev each have 30 days), and has Passover start on Thursday. */
10741
- '1720': empty.concat(RH, 52, SUKKOT, SHMINI, range$1(0, 27), CHMPESACH, range$1(28, 33), SHAVUOT$1, range$1(34, 37), D(38), 40, D(41), range$1(43, 49), D(50)),
10756
+ '1720': yearStartRH.concat(r027, CHMPESACH, range$1(28, 33), SHAVUOT$1, range$1(34, 37), D(38), 40, D(41), r4349, D(50)),
10742
10757
  };
10743
10758
  /* Hebrew year that starts on Monday, is `complete' (Heshvan and
10744
10759
  * Kislev each have 30 days), and has Passover start on Thursday. */
@@ -10762,6 +10777,8 @@ types['1311'] = types['1221'];
10762
10777
  types['1721'] = types['170'];
10763
10778
  const sedraCache = new QuickLRU({ maxSize: 400 });
10764
10779
  /**
10780
+ * Convenience function to create an instance of `Sedra` or reuse a previously
10781
+ * created and cached instance.
10765
10782
  * @private
10766
10783
  * @param {number} hyear
10767
10784
  * @param {boolean} il
@@ -11426,7 +11443,7 @@ class DailyLearning {
11426
11443
  }
11427
11444
 
11428
11445
  /** DO NOT EDIT THIS AUTO-GENERATED FILE! */
11429
- const version = '5.4.4';
11446
+ const version = '5.4.6';
11430
11447
 
11431
11448
  /* eslint-disable max-len */
11432
11449
  /**
@@ -11993,15 +12010,16 @@ function tachanunYear(year, il) {
11993
12010
  if (shushPurim.getDay() === 6) {
11994
12011
  shushPurim = shushPurim.next();
11995
12012
  }
11996
- const empty = [];
11997
- const none = empty.concat(
12013
+ const none = [
12014
+ new HDate(2, months.TISHREI, year), // Rosh Hashana II
12015
+ ].concat(
11998
12016
  // Rosh Chodesh - 1st of every month. Also includes RH day 1 (1 Tishrei)
11999
12017
  range(1, monthsInYear)
12000
12018
  .map((month) => new HDate(1, month, year)),
12001
12019
  // Rosh Chodesh - 30th of months that have one
12002
12020
  range(1, monthsInYear)
12003
12021
  .filter((month) => HDate.daysInMonth(month, year) === 30)
12004
- .map((month) => new HDate(30, month, year)), new HDate(2, months.TISHREI, year), // Rosh Hashana II
12022
+ .map((month) => new HDate(30, month, year)),
12005
12023
  // entire month of Nisan
12006
12024
  range(1, HDate.daysInMonth(months.NISAN, year))
12007
12025
  .map((mday) => new HDate(mday, months.NISAN, year)), new HDate(18, months.IYYAR, year), // Lag BaOmer
@@ -12018,13 +12036,15 @@ function tachanunYear(year, il) {
12018
12036
  .map((mday) => new HDate(mday, months.KISLEV, year)), new HDate(15, months.SHVAT, year), // Tu BiShvat
12019
12037
  new HDate(14, months.ADAR_II, year), // Purim
12020
12038
  shushPurim, leap ? new HDate(14, months.ADAR_I, year) : []);
12021
- const some = empty.concat(
12039
+ const some = [
12040
+ new HDate(14, months.IYYAR, year), // Pesach Sheini
12041
+ ].concat(
12022
12042
  // Until 14 Sivan
12023
12043
  range(1, 13)
12024
12044
  .map((mday) => new HDate(mday, months.SIVAN, year)),
12025
12045
  // Until after Rosh Chodesh Cheshvan
12026
12046
  range(20, 31)
12027
- .map((mday) => new HDate(mday, months.TISHREI, year)), new HDate(14, months.IYYAR, year), // Pesach Sheini
12047
+ .map((mday) => new HDate(mday, months.TISHREI, year)),
12028
12048
  // Yom HaAtzma'ut, which changes based on day of week
12029
12049
  year >= 5708 ? dateYomHaZikaron(year).next() : [],
12030
12050
  // Yom Yerushalayim