@hebcal/core 6.7.0 → 6.8.0

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.
Files changed (55) hide show
  1. package/dist/bundle.js +44 -48
  2. package/dist/bundle.js.map +1 -1
  3. package/dist/bundle.min.js +3 -3
  4. package/dist/bundle.min.js.map +1 -1
  5. package/dist/esm/DailyLearning.js +1 -1
  6. package/dist/esm/HebrewDateEvent.js +1 -1
  7. package/dist/esm/HolidayEvent.d.ts +2 -2
  8. package/dist/esm/HolidayEvent.js +3 -5
  9. package/dist/esm/HolidayEvent.js.map +1 -1
  10. package/dist/esm/MevarchimChodeshEvent.js +1 -1
  11. package/dist/esm/ParshaEvent.js +1 -1
  12. package/dist/esm/TimedEvent.js +1 -1
  13. package/dist/esm/YomKippurKatanEvent.js +1 -1
  14. package/dist/esm/ashkenazi.po.js +1 -1
  15. package/dist/esm/calendar.js +4 -4
  16. package/dist/esm/calendar.js.map +1 -1
  17. package/dist/esm/candles.js +1 -1
  18. package/dist/esm/cities.json.js +1 -1
  19. package/dist/esm/event.js +2 -2
  20. package/dist/esm/event.js.map +1 -1
  21. package/dist/esm/getStartAndEnd.js +8 -6
  22. package/dist/esm/getStartAndEnd.js.map +1 -1
  23. package/dist/esm/hallel.js +1 -1
  24. package/dist/esm/he-x-NoNikud.po.js +1 -1
  25. package/dist/esm/he.po.js +1 -1
  26. package/dist/esm/hebcal.js +1 -1
  27. package/dist/esm/holidays.js +6 -5
  28. package/dist/esm/holidays.js.map +1 -1
  29. package/dist/esm/index.js +1 -1
  30. package/dist/esm/isAssurBemlacha.js +1 -1
  31. package/dist/esm/isAveilut.js +1 -1
  32. package/dist/esm/isFastDay.js +1 -1
  33. package/dist/esm/locale.js +1 -1
  34. package/dist/esm/location.js +12 -13
  35. package/dist/esm/location.js.map +1 -1
  36. package/dist/esm/modern.js +1 -1
  37. package/dist/esm/molad.js +5 -5
  38. package/dist/esm/molad.js.map +1 -1
  39. package/dist/esm/moladBase.js +1 -1
  40. package/dist/esm/moladDate.js +1 -1
  41. package/dist/esm/omer.js +1 -1
  42. package/dist/esm/parshaName.js +1 -1
  43. package/dist/esm/parshaYear.js +1 -1
  44. package/dist/esm/pkgVersion.d.ts +1 -1
  45. package/dist/esm/pkgVersion.js +2 -2
  46. package/dist/esm/pkgVersion.js.map +1 -1
  47. package/dist/esm/reformatTimeStr.js +1 -1
  48. package/dist/esm/sedra.js +10 -14
  49. package/dist/esm/sedra.js.map +1 -1
  50. package/dist/esm/sefira.json.js +1 -1
  51. package/dist/esm/staticHolidays.js +1 -1
  52. package/dist/esm/string.js +1 -1
  53. package/dist/esm/tachanun.js +1 -1
  54. package/dist/esm/zmanim.js +1 -1
  55. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.7.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.8.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import 'temporal-polyfill/global';
3
3
  import { getTimezoneOffset } from '@hebcal/hdate';
4
4
 
package/dist/esm/omer.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.7.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.8.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import { Locale, gematriya } from '@hebcal/hdate';
3
3
  import { Event, flags } from './event.js';
4
4
  import './locale.js';
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.7.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.8.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import './locale.js';
3
3
  import { smartApostrophe } from './string.js';
4
4
  import { Locale } from '@hebcal/hdate';
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.7.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.8.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import { HDate, months } from '@hebcal/hdate';
3
3
  import { ParshaEvent } from './ParshaEvent.js';
4
4
  import { getSedra } from './sedra.js';
@@ -1,2 +1,2 @@
1
1
  /** DO NOT EDIT THIS AUTO-GENERATED FILE! */
2
- export declare const version = "6.7.0";
2
+ export declare const version = "6.8.0";
@@ -1,6 +1,6 @@
1
- /*! @hebcal/core v6.7.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.8.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  /** DO NOT EDIT THIS AUTO-GENERATED FILE! */
3
- const version = '6.7.0';
3
+ const version = '6.8.0';
4
4
 
5
5
  export { version };
6
6
  //# sourceMappingURL=pkgVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pkgVersion.js","sources":["../../../src/pkgVersion.ts"],"sourcesContent":["/** DO NOT EDIT THIS AUTO-GENERATED FILE! */\nexport const version = '6.7.0';\n"],"names":[],"mappings":";AAAA;AACO,MAAM,OAAO,GAAG;;;;"}
1
+ {"version":3,"file":"pkgVersion.js","sources":["../../../src/pkgVersion.ts"],"sourcesContent":["/** DO NOT EDIT THIS AUTO-GENERATED FILE! */\nexport const version = '6.8.0';\n"],"names":[],"mappings":";AAAA;AACO,MAAM,OAAO,GAAG;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.7.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.8.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  const hour12cc = {
3
3
  US: 1,
4
4
  CA: 1,
package/dist/esm/sedra.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.7.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.8.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import { HDate, months } from '@hebcal/hdate';
3
3
  import QuickLRU from 'quick-lru';
4
4
  import './locale.js';
@@ -43,12 +43,10 @@ function yearType(hyear) {
43
43
  if (longC && !shortK) {
44
44
  return COMPLETE;
45
45
  }
46
- else if (!longC && shortK) {
46
+ if (!longC && shortK) {
47
47
  return INCOMPLETE;
48
48
  }
49
- else {
50
- return REGULAR;
51
- }
49
+ return REGULAR;
52
50
  }
53
51
  /**
54
52
  * Represents the weekly Torah-reading (Parashat HaShavua) schedule for an
@@ -137,23 +135,21 @@ class Sedra {
137
135
  }
138
136
  return this.findInternal(parsha);
139
137
  }
140
- else if (typeof parsha === 'string') {
138
+ if (typeof parsha === 'string') {
141
139
  const num = parsha2id.get(parsha);
142
140
  if (typeof num === 'number') {
143
141
  return this.find(num);
144
142
  }
145
- else if (parsha.includes('-')) {
143
+ if (parsha.includes('-')) {
146
144
  if (parsha === CHMPESACH || parsha === CHMSUKOT) {
147
145
  return this.findInternal(parsha);
148
146
  }
149
147
  return this.find(parsha.split('-'));
150
148
  }
151
- else {
152
- // try to find Saturday holiday like 'Yom Kippur'
153
- return this.findInternal(parsha);
154
- }
149
+ // try to find Saturday holiday like 'Yom Kippur'
150
+ return this.findInternal(parsha);
155
151
  }
156
- else if (Array.isArray(parsha)) {
152
+ if (Array.isArray(parsha)) {
157
153
  const plen = parsha.length;
158
154
  if ((plen !== 1 && plen !== 2) || typeof parsha[0] !== 'string') {
159
155
  throw new TypeError(`Invalid parsha argument: ${JSON.stringify(parsha)}`);
@@ -292,7 +288,7 @@ class Sedra {
292
288
  if (isNaN(abs)) {
293
289
  throw new TypeError(`Bad date argument: ${hd}`);
294
290
  }
295
- else if (abs < this.rh) {
291
+ if (abs < this.rh) {
296
292
  throw new RangeError(`Date ${hd} before start of Hebrew year ${this.year}`);
297
293
  }
298
294
  // find the first saturday on or after today's date
@@ -343,7 +339,7 @@ class Sedra {
343
339
  if (isNaN(abs)) {
344
340
  throw new TypeError(`Bad date argument: ${hd}`);
345
341
  }
346
- else if (abs < this.rh) {
342
+ if (abs < this.rh) {
347
343
  throw new RangeError(`Date ${hd} before start of Hebrew year ${this.year}`);
348
344
  }
349
345
  const hdate = new HDate(abs);
@@ -1 +1 @@
1
- {"version":3,"file":"sedra.js","sources":["../../../src/sedra.ts"],"sourcesContent":["/*\n Hebcal - A Jewish Calendar Generator\n Copyright (c) 1994-2020 Danny Sadinoff\n Portions copyright Eyal Schachter and Michael J. Radwin\n\n https://github.com/hebcal/hebcal-es6\n\n This program is free software; you can redistribute it and/or\n modify it under the terms of the GNU General Public License\n as published by the Free Software Foundation; either version 2\n of the License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n/*\n * Many of the following algorithms were taken from hebrew calendar\n * routines by Maimonedes, from his Mishneh Torah, and implemented by\n * Nachum Dershowitz Department of Computer Science\n * (217) 333-4219 University of Illinois at Urbana-Champaign\n * nachum@cs.uiuedu 1304 West Springfield Avenue\n * Urbana, Illinois 61801\n *\n * The routines were included in the emacs 19 distribution.\n *\n */\nimport {HDate, months} from '@hebcal/hdate';\nimport QuickLRU from 'quick-lru';\nimport './locale'; // Adds Hebrew and Ashkenazic translations\n\nconst INCOMPLETE = 0;\nconst REGULAR = 1;\nconst COMPLETE = 2;\n\nfunction yearType(hyear: number): number {\n const longC = HDate.longCheshvan(hyear);\n const shortK = HDate.shortKislev(hyear);\n if (longC && !shortK) {\n return COMPLETE;\n } else if (!longC && shortK) {\n return INCOMPLETE;\n } else {\n return REGULAR;\n }\n}\n\n/** The result from `Sedra.lookup()` */\nexport type SedraResult = {\n /**\n * Name of the parsha (or parshiyot) read on\n * Hebrew date, e.g. `['Noach']` or `['Matot', 'Masei']`\n */\n parsha: string[];\n /**\n * False if this is a regular parashat HaShavua reading.\n * True if it's a special holiday reading.\n */\n chag: boolean;\n /**\n * The parsha number (or numbers) using 1-indexing.\n * A `number` for a regular (single) parsha, and a `number[]`\n * for a doubled parsha.\n * For Parashat *Bereshit*, `num` would be equal to `1`, and for\n * *Matot-Masei* it would be `[42, 43]`\n * For a chag (holiday) reading, `num` will be `0`.\n */\n num: number | number[];\n /** The date of the Shabbat this parsha is read */\n hdate: HDate;\n /** true if Israel, false for Diaspora */\n il: boolean;\n};\n\n/**\n * Represents the weekly Torah-reading (Parashat HaShavua) schedule for an\n * entire Hebrew year.\n *\n * The schedule depends on the year's *keviyah* — the day of week of Rosh\n * Hashana, whether the year is leap, whether Cheshvan/Kislev are long or\n * short, and whether the schedule is for Israel or the Diaspora (since\n * Israel and the Diaspora diverge in some years when the 8th day of Pesach\n * or the 2nd day of Shavuot fall on Shabbat).\n *\n * Prefer {@link getSedra} (or {@link HebrewCalendar.getSedra}) over\n * calling this constructor directly, since both cache their results.\n *\n * @example\n * import {Sedra, HDate, months} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * const result = sedra.lookup(new HDate(15, months.CHESHVAN, 5784));\n * console.log(result.parsha); // ['Lech-Lecha']\n */\nexport class Sedra {\n private readonly year: number;\n private readonly il: boolean;\n private readonly rh: number;\n private readonly firstSaturday: number;\n private readonly theSedraArray: readonly NumberOrString[];\n private readonly yearKey: string;\n /**\n * Calculates the Parashat HaShavua schedule for an entire Hebrew year.\n * @param hyear - Hebrew year (e.g. 5749)\n * @param il - Use Israel sedra schedule (false for Diaspora)\n */\n constructor(hyear: number, il: boolean) {\n hyear = +hyear;\n this.year = hyear;\n\n const rh0 = new HDate(1, months.TISHREI, hyear);\n const rh = (this.rh = rh0.abs());\n const rhDay = rh0.getDay() + 1;\n\n // find the first Saturday on or after Rosh Hashana\n this.firstSaturday = HDate.dayOnOrBefore(6, rh + 6);\n const leap = +HDate.isLeapYear(hyear);\n this.il = Boolean(il);\n\n const type = yearType(hyear);\n let key = `${leap}${rhDay}${type}`;\n if (types[key]) {\n this.theSedraArray = types[key];\n this.yearKey = key;\n } else {\n key = key + +this.il; // cast to num, then concat\n this.theSedraArray = types[key];\n this.yearKey = key;\n }\n\n if (!this.theSedraArray) {\n throw new Error(`improper sedra year type ${key} calculated for ${hyear}`);\n }\n }\n\n /**\n * Returns the date a parsha is read this year, or `null` if it does not\n * occur in this year's schedule.\n *\n * A doubled parsha (e.g. `'Matot-Masei'`) will only return a date in years\n * where that pair is actually read together; in years where they are read\n * separately, this returns `null`. Use {@link findContaining} to find the\n * date a parsha is read regardless of whether it is doubled.\n *\n * Throws `RangeError` for an out-of-range numeric input or an invalid\n * doubled-parsha pair, and `TypeError` for a malformed array argument.\n * @example\n * import {Sedra} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * sedra.find('Noach')?.toString(); // '15 Cheshvan 5784'\n * sedra.find(1)?.toString(); // same, by 0-based index\n * sedra.find('Matot-Masei')?.toString(); // null in 5784 — read separately\n * sedra.find(['Matot', 'Masei']); // also null in 5784\n * @param parsha if a `string`, specified with Sephardic transliterations\n * like `'Noach'` or `'Matot-Masei'`. If an array, must be a 1- or 2-element\n * array such as `['Noach']` or `['Matot', 'Masei']`. If a `number`, should\n * be a 0-based parsha index (`0` for Bereshit, `1` for Noach) or a negative\n * number for a doubled parsha (e.g. `-21` for Vayakhel-Pekudei)\n */\n find(parsha: number | string | string[]): HDate | null {\n if (typeof parsha === 'number') {\n if (parsha >= parshiot.length || (parsha < 0 && !isValidDouble(parsha))) {\n throw new RangeError(`Invalid parsha number: ${parsha}`);\n }\n return this.findInternal(parsha);\n } else if (typeof parsha === 'string') {\n const num = parsha2id.get(parsha);\n if (typeof num === 'number') {\n return this.find(num);\n } else if (parsha.includes('-')) {\n if (parsha === CHMPESACH || parsha === CHMSUKOT) {\n return this.findInternal(parsha);\n }\n return this.find(parsha.split('-'));\n } else {\n // try to find Saturday holiday like 'Yom Kippur'\n return this.findInternal(parsha);\n }\n } else if (Array.isArray(parsha)) {\n const plen = parsha.length;\n if ((plen !== 1 && plen !== 2) || typeof parsha[0] !== 'string') {\n throw new TypeError(`Invalid parsha argument: ${JSON.stringify(parsha)}`);\n }\n if (plen === 1) {\n return this.find(parsha[0]);\n }\n const p1 = parsha[0];\n const p2 = parsha[1];\n const num1 = parsha2id.get(p1);\n const num2 = parsha2id.get(p2);\n if (\n typeof num1 !== 'number' ||\n typeof num2 !== 'number' ||\n num2 !== num1 + 1 ||\n !isValidDouble(-num1)\n ) {\n throw new RangeError(`Unrecognized parsha name: ${p1}-${p2}`);\n }\n return this.find(-num1);\n }\n return null; /* NOTREACHED */\n }\n\n private findInternal(parsha: NumberOrString): HDate | null {\n const idx = this.theSedraArray.indexOf(parsha);\n if (idx === -1) {\n return null; // doesn't occur this year\n }\n return new HDate(this.firstSaturday + idx * 7);\n }\n\n /**\n * Returns the date a parsha is read this year, looking through both\n * single and doubled forms.\n *\n * For example, if `'Matot'` is read individually this year, this returns\n * its date; if it is read as part of `'Matot-Masei'` this year, this\n * returns the date of `'Matot-Masei'` (and similarly for `'Masei'`).\n * Conversely, asking for `'Matot-Masei'` in a year where they are split\n * will return the date of `'Matot'` alone.\n * @example\n * import {Sedra} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * // Matot-Masei is split in 5784; both individual halves resolve:\n * sedra.findContaining('Matot')?.toString(); // '22 Tamuz 5784'\n * sedra.findContaining('Masei')?.toString(); // '29 Tamuz 5784'\n * // Asking for the doubled name returns the date of the first half:\n * sedra.findContaining('Matot-Masei')?.toString(); // '22 Tamuz 5784'\n */\n findContaining(parsha: number | string): HDate | null {\n const hdate = this.find(parsha);\n if (hdate) {\n return hdate;\n }\n if (typeof parsha === 'number') {\n // a valid negative number (double parsha in a year where they are\n // combined) would've been found above, and a invalid negative number\n // would've thrown an error, so this parsha must be a positive number\n // representing either p1 or p2\n const p1 = -parsha;\n if (isValidDouble(p1)) {\n return this.find(p1);\n } else {\n // this must be the second individual parsha of a doubled pair\n // for example 29 for Kedoshim, so check for -28 for Achrei Mot-Kedoshim\n return this.find(p1 + 1);\n }\n } else {\n const num = parsha2id.get(parsha);\n if (num) {\n // parsha is either the first or second individual parsha of\n // a pair that is doubled this year\n const p1 = -num;\n if (isValidDouble(p1)) {\n return this.find(p1);\n } else {\n return this.find(p1 + 1);\n }\n } else {\n // this was indeed a doubled parsha, so return date of the first half\n const [p1] = parsha.split('-');\n return this.find(p1);\n }\n }\n }\n\n /**\n * Returns the underlying annual reading schedule as an array, where each\n * entry corresponds to one Saturday (starting from the first Shabbat on\n * or after Rosh Hashana). Entries are either:\n * - a non-negative `number`: a 0-based parsha index (e.g. `0` for\n * *Bereshit*)\n * - a negative `number`: the negated first index of a doubled parsha\n * (e.g. `-21` for *Vayakhel-Pekudei*)\n * - a `string`: a holiday name when a Yom Tov displaces the weekly reading\n * (e.g. `'Pesach Shabbat Chol ha-Moed'`, `'Yom Kippur'`)\n *\n * Used by `@hebcal/triennial`.\n */\n getSedraArray(): readonly NumberOrString[] {\n return this.theSedraArray;\n }\n\n /**\n * Returns the R.D. (Rata Die / Fixed Date) absolute day number of the\n * first Saturday on or after Rosh Hashana of this year. This is the\n * anchor point for {@link getSedraArray} — index `0` of that array\n * corresponds to this date.\n */\n getFirstSaturday(): number {\n return this.firstSaturday;\n }\n\n /** Returns the Hebrew year this `Sedra` instance covers. */\n getYear(): number {\n return this.year;\n }\n\n /**\n * Returns details about the parsha read on the first Saturday on or after\n * `hd`. If `hd` is itself a Saturday, the reading for that date is\n * returned; otherwise the reading for the upcoming Saturday is returned.\n *\n * If the given date falls in the final days of the Hebrew year (after\n * the last reading of this year's schedule), this method transparently\n * delegates to the next year's `Sedra`.\n * @example\n * import {Sedra, HDate, months} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * // A weekday — returns the upcoming Shabbat's reading\n * const result = sedra.lookup(new HDate(13, months.CHESHVAN, 5784));\n * console.log(result.parsha); // ['Lech-Lecha']\n * console.log(result.chag); // false\n * console.log(result.hdate.toString()); // '15 Cheshvan 5784' (Saturday)\n * @param hd Hebrew date or R.D. days\n */\n lookup(hd: HDate | number): SedraResult {\n const abs = typeof hd === 'number' ? hd : HDate.isHDate(hd) ? hd.abs() : NaN;\n\n if (isNaN(abs)) {\n throw new TypeError(`Bad date argument: ${hd}`);\n } else if (abs < this.rh) {\n throw new RangeError(`Date ${hd} before start of Hebrew year ${this.year}`);\n }\n\n // find the first saturday on or after today's date\n const saturday = HDate.dayOnOrBefore(6, abs + 6);\n\n const weekNum = (saturday - this.firstSaturday) / 7;\n const index = this.theSedraArray[weekNum];\n\n if (index === undefined) {\n const sedra = getSedra(this.year + 1, this.il);\n return sedra.lookup(saturday); // must be next year\n }\n const hdate = new HDate(saturday);\n if (typeof index === 'string') {\n // Shabbat has a chag. Return a description\n return {parsha: [index], chag: true, hdate, il: this.il, num: 0};\n }\n if (index >= 0) {\n return {\n parsha: [parshiot[index]],\n chag: false,\n num: index + 1,\n hdate,\n il: this.il,\n };\n }\n\n const p1 = D(index); // undouble the parsha\n return {\n parsha: [parshiot[p1], parshiot[p1 + 1]],\n chag: false,\n num: [p1 + 1, p1 + 2],\n hdate,\n il: this.il,\n };\n }\n\n /**\n * Returns details about the parsha read on Monday or Thursday for `hd`, or\n * `undefined` if `hd` is not a Monday or Thursday.\n *\n * Weekday Torah readings generally begin the upcoming Shabbat parsha. When\n * the upcoming Shabbat is a holiday, this method returns the next regular\n * parsha instead.\n *\n * For the Tishrei weekdays before Sukkot or Simchat Torah, the weekday\n * reading is *Vezot Haberakhah* even though it is not read on Shabbat.\n * @param hd Hebrew date or R.D. days\n */\n lookupWeekday(hd: HDate | number): SedraResult | undefined {\n const abs = typeof hd === 'number' ? hd : HDate.isHDate(hd) ? hd.abs() : NaN;\n\n if (isNaN(abs)) {\n throw new TypeError(`Bad date argument: ${hd}`);\n } else if (abs < this.rh) {\n throw new RangeError(`Date ${hd} before start of Hebrew year ${this.year}`);\n }\n\n const hdate = new HDate(abs);\n const day = hdate.getDay();\n if (day !== 1 && day !== 4) {\n return undefined;\n }\n\n const saturday = new HDate(HDate.dayOnOrBefore(6, abs + 6));\n const parsha = this.lookup(saturday);\n if (!parsha.chag) {\n return parsha;\n }\n return this.findWeekdayParsha(saturday);\n }\n\n private findWeekdayParsha(saturday: HDate): SedraResult {\n const hyear = saturday.getFullYear();\n const il = this.il;\n\n if (saturday.getMonth() === months.TISHREI) {\n const dd = saturday.getDate();\n const simchatTorah = il ? 22 : 23;\n if (dd > 2 && dd <= simchatTorah) {\n return {\n parsha: ['Vezot Haberakhah'],\n chag: false,\n num: 54,\n hdate: saturday,\n il,\n };\n }\n }\n\n const sedra = hyear === this.year ? this : getSedra(hyear, il);\n const endOfYear = new HDate(1, months.TISHREI, hyear + 1).abs() - 1;\n const endAbs = endOfYear + 30;\n for (let sat2 = saturday.abs() + 7; sat2 <= endAbs; sat2 += 7) {\n const sedra2 = sat2 > endOfYear ? getSedra(hyear + 1, il) : sedra;\n const parsha2 = sedra2.lookup(sat2);\n if (!parsha2.chag) {\n return parsha2;\n }\n }\n /* NOTREACHED */\n throw new Error(`can't find weekday parsha for ${saturday}/${il}`);\n }\n}\n\n/**\n * The 54 parshiyot of the Torah as transilterated strings.\n * * parshiot[0] == `Bereshit`\n * * parshiot[1] == `Noach`\n * * parshiot[52] == `Ha'azinu`\n * * parshiot[53] == `Vezot Haberakhah`\n * @readonly\n * @type {string[]}\n */\nexport const parshiot: readonly string[] = [\n 'Bereshit',\n 'Noach',\n 'Lech-Lecha',\n 'Vayera',\n 'Chayei Sara',\n 'Toldot',\n 'Vayetzei',\n 'Vayishlach',\n 'Vayeshev',\n 'Miketz',\n 'Vayigash',\n 'Vayechi',\n 'Shemot',\n 'Vaera',\n 'Bo',\n 'Beshalach',\n 'Yitro',\n 'Mishpatim',\n 'Terumah',\n 'Tetzaveh',\n 'Ki Tisa',\n 'Vayakhel',\n 'Pekudei',\n 'Vayikra',\n 'Tzav',\n 'Shmini',\n 'Tazria',\n 'Metzora',\n 'Achrei Mot',\n 'Kedoshim',\n 'Emor',\n 'Behar',\n 'Bechukotai',\n 'Bamidbar',\n 'Nasso',\n \"Beha'alotcha\",\n \"Sh'lach\",\n 'Korach',\n 'Chukat',\n 'Balak',\n 'Pinchas',\n 'Matot',\n 'Masei',\n 'Devarim',\n 'Vaetchanan',\n 'Eikev',\n \"Re'eh\",\n 'Shoftim',\n 'Ki Teitzei',\n 'Ki Tavo',\n 'Nitzavim',\n 'Vayeilech',\n \"Ha'azinu\",\n 'Vezot Haberakhah',\n] as const;\n\n// 0-based parsha IDs\nconst parsha2id = new Map<string, number>();\nfor (let id = 0; id < parshiot.length; id++) {\n const name = parshiot[id];\n parsha2id.set(name, id);\n}\n\n// 0-based parsha IDs\nconst doubles = new Set([\n 21, // Vayakhel-Pekudei\n 26, // Tazria-Metzora\n 28, // Achrei Mot-Kedoshim\n 31, // Behar-Bechukotai\n 38, // Chukat-Balak\n 41, // Matot-Masei\n 50, // Nitzavim-Vayeilech\n]);\n\n/**\n * @private\n * @param id a negative number\n */\nfunction isValidDouble(id: number): boolean {\n return doubles.has(-id);\n}\n\n/**\n * parsha doubler/undoubler\n * @private\n * @param p\n */\nfunction D(p: number): number {\n return -p;\n}\n\nconst RH = 'Rosh Hashana'; // 0\nconst YK = 'Yom Kippur'; // 1\n\nconst SUKKOT = 'Sukkot'; // 0\nconst CHMSUKOT = 'Sukkot Shabbat Chol ha-Moed'; // 0\nconst SHMINI = 'Shmini Atzeret'; // 0\n\nconst PESACH = 'Pesach'; // 25\nconst PESACH1 = 'Pesach I';\nconst CHMPESACH = 'Pesach Shabbat Chol ha-Moed'; // 25\nconst PESACH7 = 'Pesach VII'; // 25\nconst PESACH8 = 'Pesach VIII';\nconst SHAVUOT = 'Shavuot'; // 33\n\n/**\n * Returns an array from start to end\n * @private\n * @param start beginning number, inclusive\n * @param stop ending number, inclusive\n */\nfunction range(start: number, stop: number): readonly number[] {\n return Array.from({length: stop - start + 1}, (v, k) => k + start);\n}\n\ntype NumberOrString = number | string;\n\nconst yearStartVayeilech: readonly NumberOrString[] = [51, 52, CHMSUKOT];\nconst yearStartHaazinu: readonly NumberOrString[] = [52, YK, CHMSUKOT];\nconst yearStartRH: readonly NumberOrString[] = [RH, 52, SUKKOT, SHMINI];\nconst r020 = range(0, 20);\nconst r027 = range(0, 27);\nconst r3340 = range(33, 40);\nconst r4349 = range(43, 49);\nconst r4350 = range(43, 50);\n\n/**\n * The ordinary year types (keviot)\n * names are leap/nonleap - day - incomplete/regular/complete - diaspora/Israel\n * @private\n * @readonly\n */\nconst types: Record<string, readonly NumberOrString[]> = {\n /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Tuesday. */\n // e.g. 5753\n '020': yearStartVayeilech.concat(\n r020,\n D(21),\n 23,\n 24,\n CHMPESACH,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\n // e.g. 5756\n '0220': yearStartVayeilech.concat(\n r020,\n D(21),\n 23,\n 24,\n CHMPESACH,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n 33,\n SHAVUOT,\n range(34, 37),\n D(38),\n 40,\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\n // e.g. 5701\n '0510': yearStartHaazinu.concat(\n r020,\n D(21),\n 23,\n 24,\n PESACH1,\n PESACH8,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\n // e.g. 5745\n '0511': yearStartHaazinu.concat(\n r020,\n D(21),\n 23,\n 24,\n PESACH,\n 25,\n D(26),\n D(28),\n range(30, 40),\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Thursday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Sunday. */\n // e.g. 5754\n '052': yearStartHaazinu.concat(\n range(0, 24),\n PESACH7,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and Kislev\n * each have 29 days), and has Passover start on Sunday. */\n // e.g. 5761\n '070': yearStartRH.concat(\n r020,\n D(21),\n 23,\n 24,\n PESACH7,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Saturday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Tuesday. */\n // e.g. 5716\n '072': yearStartRH.concat(\n r020,\n D(21),\n 23,\n 24,\n CHMPESACH,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4349,\n D(50)\n ),\n\n /* -- The leap year types (keviot) -- */\n /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Thursday. */\n // e.g. 5746\n '1200': yearStartVayeilech.concat(\n r027,\n CHMPESACH,\n range(28, 33),\n SHAVUOT,\n range(34, 37),\n D(38),\n 40,\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Thursday. */\n // e.g. 5746\n '1201': yearStartVayeilech.concat(\n r027,\n CHMPESACH,\n range(28, 40),\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Saturday. */\n // e.g.5752\n '1220': yearStartVayeilech.concat(\n r027,\n PESACH1,\n PESACH8,\n range(28, 40),\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Saturday. */\n // e.g.5752\n '1221': yearStartVayeilech.concat(r027, PESACH, range(28, 50)),\n\n /* Hebrew year that starts on Thursday, is `incomplete' (Heshvan and\n * Kislev both have 29 days), and has Passover start on Sunday. */\n // e.g. 5768\n '150': yearStartHaazinu.concat(range(0, 28), PESACH7, range(29, 50)),\n\n /* Hebrew year that starts on Thursday, is `complete' (Heshvan and\n * Kislev both have 30 days), and has Passover start on Tuesday. */\n // eg. 5771\n '152': yearStartHaazinu.concat(range(0, 28), CHMPESACH, range(29, 49), D(50)),\n\n /* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Tuesday. */\n // e.g.5757\n '170': yearStartRH.concat(r027, CHMPESACH, range(28, 40), D(41), r4349, D(50)),\n\n /* Hebrew year that starts on Saturday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\n '1720': yearStartRH.concat(\n r027,\n CHMPESACH,\n range(28, 33),\n SHAVUOT,\n range(34, 37),\n D(38),\n 40,\n D(41),\n r4349,\n D(50)\n ),\n} as const;\n\n/* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\ntypes['0221'] = types['020'];\n\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Thursday. */\n// e.g. 5715\ntypes['0310'] = types['0220'];\n\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Thursday. */\ntypes['0311'] = types['020'];\n\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\n// e.g. 5715\ntypes['1310'] = types['1220'];\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\ntypes['1311'] = types['1221'];\n\n/* Hebrew year that starts on Saturday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\ntypes['1721'] = types['170'];\n\nconst sedraCache = new QuickLRU<string, Sedra>({maxSize: 120});\n\n/**\n * Convenience function to create an instance of {@link Sedra} or reuse a\n * previously created and cached instance for the same year and schedule.\n *\n * Prefer this over `new Sedra(...)` when calling repeatedly — an internal\n * LRU cache (~120 entries) avoids recomputing the keviyah-specific schedule.\n * @example\n * import {getSedra, HDate, months} from '@hebcal/core';\n * const sedra = getSedra(5784, false);\n * const {parsha} = sedra.lookup(new HDate(15, months.CHESHVAN, 5784));\n * console.log(parsha); // ['Lech-Lecha']\n * @param hyear Hebrew year\n * @param il Use Israel sedra schedule (`false` for Diaspora)\n */\nexport function getSedra(hyear: number, il: boolean): Sedra {\n const cacheKey = `${hyear}-${il ? 1 : 0}`;\n let sedra = sedraCache.get(cacheKey);\n if (!sedra) {\n sedra = new Sedra(hyear, il);\n sedraCache.set(cacheKey, sedra);\n }\n return sedra;\n}\n"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;;;;;;;;;;;AAmBG;AAEH;;;;;;;;;;AAUG;AAKH,MAAM,UAAU,GAAG,CAAC;AACpB,MAAM,OAAO,GAAG,CAAC;AACjB,MAAM,QAAQ,GAAG,CAAC;AAElB,SAAS,QAAQ,CAAC,KAAa,EAAA;IAC7B,MAAM,KAAK,GAAG,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC;IACvC,MAAM,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC;AACvC,IAAA,IAAI,KAAK,IAAI,CAAC,MAAM,EAAE;AACpB,QAAA,OAAO,QAAQ;IACjB;AAAO,SAAA,IAAI,CAAC,KAAK,IAAI,MAAM,EAAE;AAC3B,QAAA,OAAO,UAAU;IACnB;SAAO;AACL,QAAA,OAAO,OAAO;IAChB;AACF;AA6BA;;;;;;;;;;;;;;;;;;AAkBG;MACU,KAAK,CAAA;AACC,IAAA,IAAI;AACJ,IAAA,EAAE;AACF,IAAA,EA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C,KAAK,EAAE,EAAE,CAAC;AAC5B,QAAA,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC;IACjC;AACA,IAAA,OAAO,KAAK;AACd;;;;"}
1
+ {"version":3,"file":"sedra.js","sources":["../../../src/sedra.ts"],"sourcesContent":["/*\n Hebcal - A Jewish Calendar Generator\n Copyright (c) 1994-2020 Danny Sadinoff\n Portions copyright Eyal Schachter and Michael J. Radwin\n\n https://github.com/hebcal/hebcal-es6\n\n This program is free software; you can redistribute it and/or\n modify it under the terms of the GNU General Public License\n as published by the Free Software Foundation; either version 2\n of the License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n/*\n * Many of the following algorithms were taken from hebrew calendar\n * routines by Maimonedes, from his Mishneh Torah, and implemented by\n * Nachum Dershowitz Department of Computer Science\n * (217) 333-4219 University of Illinois at Urbana-Champaign\n * nachum@cs.uiuedu 1304 West Springfield Avenue\n * Urbana, Illinois 61801\n *\n * The routines were included in the emacs 19 distribution.\n *\n */\nimport {HDate, months} from '@hebcal/hdate';\nimport QuickLRU from 'quick-lru';\nimport './locale'; // Adds Hebrew and Ashkenazic translations\n\nconst INCOMPLETE = 0;\nconst REGULAR = 1;\nconst COMPLETE = 2;\n\nfunction yearType(hyear: number): number {\n const longC = HDate.longCheshvan(hyear);\n const shortK = HDate.shortKislev(hyear);\n if (longC && !shortK) {\n return COMPLETE;\n }\n if (!longC && shortK) {\n return INCOMPLETE;\n }\n return REGULAR;\n}\n\n/** The result from `Sedra.lookup()` */\nexport type SedraResult = {\n /**\n * Name of the parsha (or parshiyot) read on\n * Hebrew date, e.g. `['Noach']` or `['Matot', 'Masei']`\n */\n parsha: string[];\n /**\n * False if this is a regular parashat HaShavua reading.\n * True if it's a special holiday reading.\n */\n chag: boolean;\n /**\n * The parsha number (or numbers) using 1-indexing.\n * A `number` for a regular (single) parsha, and a `number[]`\n * for a doubled parsha.\n * For Parashat *Bereshit*, `num` would be equal to `1`, and for\n * *Matot-Masei* it would be `[42, 43]`\n * For a chag (holiday) reading, `num` will be `0`.\n */\n num: number | number[];\n /** The date of the Shabbat this parsha is read */\n hdate: HDate;\n /** true if Israel, false for Diaspora */\n il: boolean;\n};\n\n/**\n * Represents the weekly Torah-reading (Parashat HaShavua) schedule for an\n * entire Hebrew year.\n *\n * The schedule depends on the year's *keviyah* — the day of week of Rosh\n * Hashana, whether the year is leap, whether Cheshvan/Kislev are long or\n * short, and whether the schedule is for Israel or the Diaspora (since\n * Israel and the Diaspora diverge in some years when the 8th day of Pesach\n * or the 2nd day of Shavuot fall on Shabbat).\n *\n * Prefer {@link getSedra} (or {@link HebrewCalendar.getSedra}) over\n * calling this constructor directly, since both cache their results.\n *\n * @example\n * import {Sedra, HDate, months} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * const result = sedra.lookup(new HDate(15, months.CHESHVAN, 5784));\n * console.log(result.parsha); // ['Lech-Lecha']\n */\nexport class Sedra {\n private readonly year: number;\n private readonly il: boolean;\n private readonly rh: number;\n private readonly firstSaturday: number;\n private readonly theSedraArray: readonly NumberOrString[];\n private readonly yearKey: string;\n /**\n * Calculates the Parashat HaShavua schedule for an entire Hebrew year.\n * @param hyear - Hebrew year (e.g. 5749)\n * @param il - Use Israel sedra schedule (false for Diaspora)\n */\n constructor(hyear: number, il: boolean) {\n hyear = +hyear;\n this.year = hyear;\n\n const rh0 = new HDate(1, months.TISHREI, hyear);\n const rh = (this.rh = rh0.abs());\n const rhDay = rh0.getDay() + 1;\n\n // find the first Saturday on or after Rosh Hashana\n this.firstSaturday = HDate.dayOnOrBefore(6, rh + 6);\n const leap = +HDate.isLeapYear(hyear);\n this.il = Boolean(il);\n\n const type = yearType(hyear);\n let key = `${leap}${rhDay}${type}`;\n if (types[key]) {\n this.theSedraArray = types[key];\n this.yearKey = key;\n } else {\n key = key + +this.il; // cast to num, then concat\n this.theSedraArray = types[key];\n this.yearKey = key;\n }\n\n if (!this.theSedraArray) {\n throw new Error(`improper sedra year type ${key} calculated for ${hyear}`);\n }\n }\n\n /**\n * Returns the date a parsha is read this year, or `null` if it does not\n * occur in this year's schedule.\n *\n * A doubled parsha (e.g. `'Matot-Masei'`) will only return a date in years\n * where that pair is actually read together; in years where they are read\n * separately, this returns `null`. Use {@link findContaining} to find the\n * date a parsha is read regardless of whether it is doubled.\n *\n * Throws `RangeError` for an out-of-range numeric input or an invalid\n * doubled-parsha pair, and `TypeError` for a malformed array argument.\n * @example\n * import {Sedra} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * sedra.find('Noach')?.toString(); // '15 Cheshvan 5784'\n * sedra.find(1)?.toString(); // same, by 0-based index\n * sedra.find('Matot-Masei')?.toString(); // null in 5784 — read separately\n * sedra.find(['Matot', 'Masei']); // also null in 5784\n * @param parsha if a `string`, specified with Sephardic transliterations\n * like `'Noach'` or `'Matot-Masei'`. If an array, must be a 1- or 2-element\n * array such as `['Noach']` or `['Matot', 'Masei']`. If a `number`, should\n * be a 0-based parsha index (`0` for Bereshit, `1` for Noach) or a negative\n * number for a doubled parsha (e.g. `-21` for Vayakhel-Pekudei)\n */\n find(parsha: number | string | string[]): HDate | null {\n if (typeof parsha === 'number') {\n if (parsha >= parshiot.length || (parsha < 0 && !isValidDouble(parsha))) {\n throw new RangeError(`Invalid parsha number: ${parsha}`);\n }\n return this.findInternal(parsha);\n }\n if (typeof parsha === 'string') {\n const num = parsha2id.get(parsha);\n if (typeof num === 'number') {\n return this.find(num);\n }\n if (parsha.includes('-')) {\n if (parsha === CHMPESACH || parsha === CHMSUKOT) {\n return this.findInternal(parsha);\n }\n return this.find(parsha.split('-'));\n }\n // try to find Saturday holiday like 'Yom Kippur'\n return this.findInternal(parsha);\n }\n if (Array.isArray(parsha)) {\n const plen = parsha.length;\n if ((plen !== 1 && plen !== 2) || typeof parsha[0] !== 'string') {\n throw new TypeError(`Invalid parsha argument: ${JSON.stringify(parsha)}`);\n }\n if (plen === 1) {\n return this.find(parsha[0]);\n }\n const p1 = parsha[0];\n const p2 = parsha[1];\n const num1 = parsha2id.get(p1);\n const num2 = parsha2id.get(p2);\n if (\n typeof num1 !== 'number' ||\n typeof num2 !== 'number' ||\n num2 !== num1 + 1 ||\n !isValidDouble(-num1)\n ) {\n throw new RangeError(`Unrecognized parsha name: ${p1}-${p2}`);\n }\n return this.find(-num1);\n }\n return null; /* NOTREACHED */\n }\n\n private findInternal(parsha: NumberOrString): HDate | null {\n const idx = this.theSedraArray.indexOf(parsha);\n if (idx === -1) {\n return null; // doesn't occur this year\n }\n return new HDate(this.firstSaturday + idx * 7);\n }\n\n /**\n * Returns the date a parsha is read this year, looking through both\n * single and doubled forms.\n *\n * For example, if `'Matot'` is read individually this year, this returns\n * its date; if it is read as part of `'Matot-Masei'` this year, this\n * returns the date of `'Matot-Masei'` (and similarly for `'Masei'`).\n * Conversely, asking for `'Matot-Masei'` in a year where they are split\n * will return the date of `'Matot'` alone.\n * @example\n * import {Sedra} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * // Matot-Masei is split in 5784; both individual halves resolve:\n * sedra.findContaining('Matot')?.toString(); // '22 Tamuz 5784'\n * sedra.findContaining('Masei')?.toString(); // '29 Tamuz 5784'\n * // Asking for the doubled name returns the date of the first half:\n * sedra.findContaining('Matot-Masei')?.toString(); // '22 Tamuz 5784'\n */\n findContaining(parsha: number | string): HDate | null {\n const hdate = this.find(parsha);\n if (hdate) {\n return hdate;\n }\n if (typeof parsha === 'number') {\n // a valid negative number (double parsha in a year where they are\n // combined) would've been found above, and a invalid negative number\n // would've thrown an error, so this parsha must be a positive number\n // representing either p1 or p2\n const p1 = -parsha;\n if (isValidDouble(p1)) {\n return this.find(p1);\n } else {\n // this must be the second individual parsha of a doubled pair\n // for example 29 for Kedoshim, so check for -28 for Achrei Mot-Kedoshim\n return this.find(p1 + 1);\n }\n } else {\n const num = parsha2id.get(parsha);\n if (num) {\n // parsha is either the first or second individual parsha of\n // a pair that is doubled this year\n const p1 = -num;\n if (isValidDouble(p1)) {\n return this.find(p1);\n } else {\n return this.find(p1 + 1);\n }\n } else {\n // this was indeed a doubled parsha, so return date of the first half\n const [p1] = parsha.split('-');\n return this.find(p1);\n }\n }\n }\n\n /**\n * Returns the underlying annual reading schedule as an array, where each\n * entry corresponds to one Saturday (starting from the first Shabbat on\n * or after Rosh Hashana). Entries are either:\n * - a non-negative `number`: a 0-based parsha index (e.g. `0` for\n * *Bereshit*)\n * - a negative `number`: the negated first index of a doubled parsha\n * (e.g. `-21` for *Vayakhel-Pekudei*)\n * - a `string`: a holiday name when a Yom Tov displaces the weekly reading\n * (e.g. `'Pesach Shabbat Chol ha-Moed'`, `'Yom Kippur'`)\n *\n * Used by `@hebcal/triennial`.\n */\n getSedraArray(): readonly NumberOrString[] {\n return this.theSedraArray;\n }\n\n /**\n * Returns the R.D. (Rata Die / Fixed Date) absolute day number of the\n * first Saturday on or after Rosh Hashana of this year. This is the\n * anchor point for {@link getSedraArray} — index `0` of that array\n * corresponds to this date.\n */\n getFirstSaturday(): number {\n return this.firstSaturday;\n }\n\n /** Returns the Hebrew year this `Sedra` instance covers. */\n getYear(): number {\n return this.year;\n }\n\n /**\n * Returns details about the parsha read on the first Saturday on or after\n * `hd`. If `hd` is itself a Saturday, the reading for that date is\n * returned; otherwise the reading for the upcoming Saturday is returned.\n *\n * If the given date falls in the final days of the Hebrew year (after\n * the last reading of this year's schedule), this method transparently\n * delegates to the next year's `Sedra`.\n * @example\n * import {Sedra, HDate, months} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * // A weekday — returns the upcoming Shabbat's reading\n * const result = sedra.lookup(new HDate(13, months.CHESHVAN, 5784));\n * console.log(result.parsha); // ['Lech-Lecha']\n * console.log(result.chag); // false\n * console.log(result.hdate.toString()); // '15 Cheshvan 5784' (Saturday)\n * @param hd Hebrew date or R.D. days\n */\n lookup(hd: HDate | number): SedraResult {\n const abs = typeof hd === 'number' ? hd : HDate.isHDate(hd) ? hd.abs() : NaN;\n\n if (isNaN(abs)) {\n throw new TypeError(`Bad date argument: ${hd}`);\n }\n if (abs < this.rh) {\n throw new RangeError(`Date ${hd} before start of Hebrew year ${this.year}`);\n }\n\n // find the first saturday on or after today's date\n const saturday = HDate.dayOnOrBefore(6, abs + 6);\n\n const weekNum = (saturday - this.firstSaturday) / 7;\n const index = this.theSedraArray[weekNum];\n\n if (index === undefined) {\n const sedra = getSedra(this.year + 1, this.il);\n return sedra.lookup(saturday); // must be next year\n }\n const hdate = new HDate(saturday);\n if (typeof index === 'string') {\n // Shabbat has a chag. Return a description\n return {parsha: [index], chag: true, hdate, il: this.il, num: 0};\n }\n if (index >= 0) {\n return {\n parsha: [parshiot[index]],\n chag: false,\n num: index + 1,\n hdate,\n il: this.il,\n };\n }\n\n const p1 = D(index); // undouble the parsha\n return {\n parsha: [parshiot[p1], parshiot[p1 + 1]],\n chag: false,\n num: [p1 + 1, p1 + 2],\n hdate,\n il: this.il,\n };\n }\n\n /**\n * Returns details about the parsha read on Monday or Thursday for `hd`, or\n * `undefined` if `hd` is not a Monday or Thursday.\n *\n * Weekday Torah readings generally begin the upcoming Shabbat parsha. When\n * the upcoming Shabbat is a holiday, this method returns the next regular\n * parsha instead.\n *\n * For the Tishrei weekdays before Sukkot or Simchat Torah, the weekday\n * reading is *Vezot Haberakhah* even though it is not read on Shabbat.\n * @param hd Hebrew date or R.D. days\n */\n lookupWeekday(hd: HDate | number): SedraResult | undefined {\n const abs = typeof hd === 'number' ? hd : HDate.isHDate(hd) ? hd.abs() : NaN;\n\n if (isNaN(abs)) {\n throw new TypeError(`Bad date argument: ${hd}`);\n }\n if (abs < this.rh) {\n throw new RangeError(`Date ${hd} before start of Hebrew year ${this.year}`);\n }\n\n const hdate = new HDate(abs);\n const day = hdate.getDay();\n if (day !== 1 && day !== 4) {\n return undefined;\n }\n\n const saturday = new HDate(HDate.dayOnOrBefore(6, abs + 6));\n const parsha = this.lookup(saturday);\n if (!parsha.chag) {\n return parsha;\n }\n return this.findWeekdayParsha(saturday);\n }\n\n private findWeekdayParsha(saturday: HDate): SedraResult {\n const hyear = saturday.getFullYear();\n const il = this.il;\n\n if (saturday.getMonth() === months.TISHREI) {\n const dd = saturday.getDate();\n const simchatTorah = il ? 22 : 23;\n if (dd > 2 && dd <= simchatTorah) {\n return {\n parsha: ['Vezot Haberakhah'],\n chag: false,\n num: 54,\n hdate: saturday,\n il,\n };\n }\n }\n\n const sedra = hyear === this.year ? this : getSedra(hyear, il);\n const endOfYear = new HDate(1, months.TISHREI, hyear + 1).abs() - 1;\n const endAbs = endOfYear + 30;\n for (let sat2 = saturday.abs() + 7; sat2 <= endAbs; sat2 += 7) {\n const sedra2 = sat2 > endOfYear ? getSedra(hyear + 1, il) : sedra;\n const parsha2 = sedra2.lookup(sat2);\n if (!parsha2.chag) {\n return parsha2;\n }\n }\n /* NOTREACHED */\n throw new Error(`can't find weekday parsha for ${saturday}/${il}`);\n }\n}\n\n/**\n * The 54 parshiyot of the Torah as transilterated strings.\n * * parshiot[0] == `Bereshit`\n * * parshiot[1] == `Noach`\n * * parshiot[52] == `Ha'azinu`\n * * parshiot[53] == `Vezot Haberakhah`\n * @readonly\n * @type {string[]}\n */\nexport const parshiot: readonly string[] = [\n 'Bereshit',\n 'Noach',\n 'Lech-Lecha',\n 'Vayera',\n 'Chayei Sara',\n 'Toldot',\n 'Vayetzei',\n 'Vayishlach',\n 'Vayeshev',\n 'Miketz',\n 'Vayigash',\n 'Vayechi',\n 'Shemot',\n 'Vaera',\n 'Bo',\n 'Beshalach',\n 'Yitro',\n 'Mishpatim',\n 'Terumah',\n 'Tetzaveh',\n 'Ki Tisa',\n 'Vayakhel',\n 'Pekudei',\n 'Vayikra',\n 'Tzav',\n 'Shmini',\n 'Tazria',\n 'Metzora',\n 'Achrei Mot',\n 'Kedoshim',\n 'Emor',\n 'Behar',\n 'Bechukotai',\n 'Bamidbar',\n 'Nasso',\n \"Beha'alotcha\",\n \"Sh'lach\",\n 'Korach',\n 'Chukat',\n 'Balak',\n 'Pinchas',\n 'Matot',\n 'Masei',\n 'Devarim',\n 'Vaetchanan',\n 'Eikev',\n \"Re'eh\",\n 'Shoftim',\n 'Ki Teitzei',\n 'Ki Tavo',\n 'Nitzavim',\n 'Vayeilech',\n \"Ha'azinu\",\n 'Vezot Haberakhah',\n] as const;\n\n// 0-based parsha IDs\nconst parsha2id = new Map<string, number>();\nfor (let id = 0; id < parshiot.length; id++) {\n const name = parshiot[id];\n parsha2id.set(name, id);\n}\n\n// 0-based parsha IDs\nconst doubles = new Set([\n 21, // Vayakhel-Pekudei\n 26, // Tazria-Metzora\n 28, // Achrei Mot-Kedoshim\n 31, // Behar-Bechukotai\n 38, // Chukat-Balak\n 41, // Matot-Masei\n 50, // Nitzavim-Vayeilech\n]);\n\n/**\n * @private\n * @param id a negative number\n */\nfunction isValidDouble(id: number): boolean {\n return doubles.has(-id);\n}\n\n/**\n * parsha doubler/undoubler\n * @private\n * @param p\n */\nfunction D(p: number): number {\n return -p;\n}\n\nconst RH = 'Rosh Hashana'; // 0\nconst YK = 'Yom Kippur'; // 1\n\nconst SUKKOT = 'Sukkot'; // 0\nconst CHMSUKOT = 'Sukkot Shabbat Chol ha-Moed'; // 0\nconst SHMINI = 'Shmini Atzeret'; // 0\n\nconst PESACH = 'Pesach'; // 25\nconst PESACH1 = 'Pesach I';\nconst CHMPESACH = 'Pesach Shabbat Chol ha-Moed'; // 25\nconst PESACH7 = 'Pesach VII'; // 25\nconst PESACH8 = 'Pesach VIII';\nconst SHAVUOT = 'Shavuot'; // 33\n\n/**\n * Returns an array from start to end\n * @private\n * @param start beginning number, inclusive\n * @param stop ending number, inclusive\n */\nfunction range(start: number, stop: number): readonly number[] {\n return Array.from({length: stop - start + 1}, (v, k) => k + start);\n}\n\ntype NumberOrString = number | string;\n\nconst yearStartVayeilech: readonly NumberOrString[] = [51, 52, CHMSUKOT];\nconst yearStartHaazinu: readonly NumberOrString[] = [52, YK, CHMSUKOT];\nconst yearStartRH: readonly NumberOrString[] = [RH, 52, SUKKOT, SHMINI];\nconst r020 = range(0, 20);\nconst r027 = range(0, 27);\nconst r3340 = range(33, 40);\nconst r4349 = range(43, 49);\nconst r4350 = range(43, 50);\n\n/**\n * The ordinary year types (keviot)\n * names are leap/nonleap - day - incomplete/regular/complete - diaspora/Israel\n * @private\n * @readonly\n */\nconst types: Record<string, readonly NumberOrString[]> = {\n /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Tuesday. */\n // e.g. 5753\n '020': yearStartVayeilech.concat(\n r020,\n D(21),\n 23,\n 24,\n CHMPESACH,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\n // e.g. 5756\n '0220': yearStartVayeilech.concat(\n r020,\n D(21),\n 23,\n 24,\n CHMPESACH,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n 33,\n SHAVUOT,\n range(34, 37),\n D(38),\n 40,\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\n // e.g. 5701\n '0510': yearStartHaazinu.concat(\n r020,\n D(21),\n 23,\n 24,\n PESACH1,\n PESACH8,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\n // e.g. 5745\n '0511': yearStartHaazinu.concat(\n r020,\n D(21),\n 23,\n 24,\n PESACH,\n 25,\n D(26),\n D(28),\n range(30, 40),\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Thursday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Sunday. */\n // e.g. 5754\n '052': yearStartHaazinu.concat(\n range(0, 24),\n PESACH7,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and Kislev\n * each have 29 days), and has Passover start on Sunday. */\n // e.g. 5761\n '070': yearStartRH.concat(\n r020,\n D(21),\n 23,\n 24,\n PESACH7,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Saturday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Tuesday. */\n // e.g. 5716\n '072': yearStartRH.concat(\n r020,\n D(21),\n 23,\n 24,\n CHMPESACH,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4349,\n D(50)\n ),\n\n /* -- The leap year types (keviot) -- */\n /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Thursday. */\n // e.g. 5746\n '1200': yearStartVayeilech.concat(\n r027,\n CHMPESACH,\n range(28, 33),\n SHAVUOT,\n range(34, 37),\n D(38),\n 40,\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Thursday. */\n // e.g. 5746\n '1201': yearStartVayeilech.concat(\n r027,\n CHMPESACH,\n range(28, 40),\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Saturday. */\n // e.g.5752\n '1220': yearStartVayeilech.concat(\n r027,\n PESACH1,\n PESACH8,\n range(28, 40),\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Saturday. */\n // e.g.5752\n '1221': yearStartVayeilech.concat(r027, PESACH, range(28, 50)),\n\n /* Hebrew year that starts on Thursday, is `incomplete' (Heshvan and\n * Kislev both have 29 days), and has Passover start on Sunday. */\n // e.g. 5768\n '150': yearStartHaazinu.concat(range(0, 28), PESACH7, range(29, 50)),\n\n /* Hebrew year that starts on Thursday, is `complete' (Heshvan and\n * Kislev both have 30 days), and has Passover start on Tuesday. */\n // eg. 5771\n '152': yearStartHaazinu.concat(range(0, 28), CHMPESACH, range(29, 49), D(50)),\n\n /* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Tuesday. */\n // e.g.5757\n '170': yearStartRH.concat(r027, CHMPESACH, range(28, 40), D(41), r4349, D(50)),\n\n /* Hebrew year that starts on Saturday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\n '1720': yearStartRH.concat(\n r027,\n CHMPESACH,\n range(28, 33),\n SHAVUOT,\n range(34, 37),\n D(38),\n 40,\n D(41),\n r4349,\n D(50)\n ),\n} as const;\n\n/* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\ntypes['0221'] = types['020'];\n\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Thursday. */\n// e.g. 5715\ntypes['0310'] = types['0220'];\n\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Thursday. */\ntypes['0311'] = types['020'];\n\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\n// e.g. 5715\ntypes['1310'] = types['1220'];\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\ntypes['1311'] = types['1221'];\n\n/* Hebrew year that starts on Saturday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\ntypes['1721'] = types['170'];\n\nconst sedraCache = new QuickLRU<string, Sedra>({maxSize: 120});\n\n/**\n * Convenience function to create an instance of {@link Sedra} or reuse a\n * previously created and cached instance for the same year and schedule.\n *\n * Prefer this over `new Sedra(...)` when calling repeatedly — an internal\n * LRU cache (~120 entries) avoids recomputing the keviyah-specific schedule.\n * @example\n * import {getSedra, HDate, months} from '@hebcal/core';\n * const sedra = getSedra(5784, false);\n * const {parsha} = sedra.lookup(new HDate(15, months.CHESHVAN, 5784));\n * console.log(parsha); // ['Lech-Lecha']\n * @param hyear Hebrew year\n * @param il Use Israel sedra schedule (`false` for Diaspora)\n */\nexport function getSedra(hyear: number, il: boolean): Sedra {\n const cacheKey = `${hyear}-${il ? 1 : 0}`;\n let sedra = sedraCache.get(cacheKey);\n if (!sedra) {\n sedra = new Sedra(hyear, il);\n sedraCache.set(cacheKey, sedra);\n }\n return sedra;\n}\n"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;;;;;;;;;;;AAmBG;AAEH;;;;;;;;;;AAUG;AAKH,MAAM,UAAU,GAAG,CAAC;AACpB,MAAM,OAAO,GAAG,CAAC;AACjB,MAAM,QAAQ,GAAG,CAAC;AAElB,SAAS,QAAQ,CAAC,KAAa,EAAA;IAC7B,MAAM,KAAK,GAAG,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC;IACvC,MAAM,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC;AACvC,IAAA,IAAI,KAAK,IAAI,CAAC,MAAM,EAAE;AACpB,QAAA,OAAO,QAAQ;IACjB;AACA,IAAA,IAAI,CAAC,KAAK,IAAI,MAAM,EAAE;AACpB,QAAA,OAAO,UAAU;IACnB;AACA,IAAA,OAAO,OAAO;AAChB;AA6BA;;;;;;;;;;;;;;;;;;AAkBG;MACU,KAAK,CAAA;AACC,IAAA,IAAI;AACJ,IAAA,EAAE;AACF,IAAA,EAAE;AACF,IAAA,aAAa;AACb,IAAA,aAAa;AACb,IAAA,OAAO;AACxB;;;;AAIG;IACH,WAAA,CAAY,KAAa,E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AK;AACd;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.7.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.8.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  const ps67lines=["אֱלֹהִים יְחָנֵּנוּ וִיבָרְכֵנוּ יָאֵר־פָּנָיו אִתָּנוּ סֶלָה","לָדַעַת בָּאָרֶץ דַּרְכֶּךָ בְּכָל־גּוֹיִם יְשׁוּעָתֶךָ","יוֹדוּךָ עַמִּים אֱלֹהִים יוֹדוּךָ עַמִּים כֻּלָּם","יִשְׂמְחוּ וִירַנְּנוּ לְאֻמִּים כִּי־תִשְׁפֹּט עַמִּים מִישׁוֹר וּלְאֻמִּים בָּאָרֶץ תַּנחֵם סֶלָה","יוֹדוּךָ עַמִּים אֱלֹהִים יוֹדוּךָ עַמִּים כֻּלָּם","אֶרֶץ נָתְנָה יְבוּלָהּ יְבָרְכֵנוּ אֱלֹהִים אֱלֹהֵינוּ","יְבָרְכֵנוּ אֱלֹהִים וְיִירְאוּ אוֹתוֹ כָּל־אַפְסֵי־אָרֶץ"];const lamnatzeachLetters="ישמחווירננולאמיםכיתשפוטעמיםמישורולאמיםבארץתנחםסלה";const anaBekoach=["אָנָּא","בְּכֹחַ","גְּדֻלַּת","יְמִינְךָ","תַּתִּיר","צְרוּרָה","אב״ג ית״ץ","קַבֵּל","רִנַּת","עַמְּךָ","שַׂגְּבֵנוּ","טַהֲרֵנוּ","נוֹרָא","קר״ע שט״ן","נָא","גִבּוֹר","דּוֹרְשֵׁי","יִחוּדְךָ","כְּבָבַת","שָׁמְרֵם","נג״ד יכ״ש","בָּרְכֵם","טַהֲרֵם","רַחֲמֵי","צִדְקָתְךָ","תָּמִיד","גָּמְלֵם","בט״ר צת״ג","חֲסִין","קָדוֹשׁ","בְּרֹב","טוּבְךָ","נַהֵל","עֲדָתֶךָ","חק״ב תנ״ע","יָחִיד","גֵּאֶה","לְעַמְּךָ","פְּנֵה","זוֹכְרֵי","קְדֻשָּׁתֶךָ","יג״ל פז״ק","שַׁוְעָתֵנוּ","קַבֵּל","וּשְׁמַע","צַעֲקָתֵנוּ","יוֹדֵעַ","תַּעֲלוּמוֹת","שק״ו צי״ת"];var sefira = {ps67lines:ps67lines,lamnatzeachLetters:lamnatzeachLetters,anaBekoach:anaBekoach};
3
3
 
4
4
  export { anaBekoach, sefira as default, lamnatzeachLetters, ps67lines };
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.7.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.8.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import { months } from '@hebcal/hdate';
3
3
  import { flags } from './event.js';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.7.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.8.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  function smartApostrophe(str) {
3
3
  return str.replaceAll("'", '’');
4
4
  }
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.7.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.8.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import { HDate, months } from '@hebcal/hdate';
3
3
  import { dateYomHaZikaron } from './modern.js';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.7.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.8.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import 'temporal-polyfill/global';
3
3
  import { NOAACalculator } from '@hebcal/noaa';
4
4
  import { HDate, isDate, getTimezoneOffset, pad2, getPseudoISO } from '@hebcal/hdate';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hebcal/core",
3
- "version": "6.7.0",
3
+ "version": "6.8.0",
4
4
  "author": "Michael J. Radwin (https://github.com/mjradwin)",
5
5
  "contributors": [
6
6
  "Eyal Schachter (https://github.com/Scimonster)",