@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
package/dist/bundle.js CHANGED
@@ -1,9 +1,9 @@
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
  var hebcal = (function (exports) {
3
3
  'use strict';
4
4
 
5
5
  /** DO NOT EDIT THIS AUTO-GENERATED FILE! */
6
- const version = '6.7.0';
6
+ const version = '6.8.0';
7
7
 
8
8
  /*! @hebcal/hdate v0.22.5, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
9
9
  /** @private */
@@ -2160,7 +2160,7 @@ class Event {
2160
2160
  if (!HDate.isHDate(date)) {
2161
2161
  throw new TypeError(`Invalid Event date: ${date}`);
2162
2162
  }
2163
- else if (typeof desc !== 'string') {
2163
+ if (typeof desc !== 'string') {
2164
2164
  throw new TypeError(`Invalid Event description: ${desc}`);
2165
2165
  }
2166
2166
  this.date = date;
@@ -8576,6 +8576,9 @@ class Location extends GeoLocation {
8576
8576
  super(cityName || null, lat, long, elev, tzid);
8577
8577
  this.il = Boolean(il);
8578
8578
  this.cc = countryCode;
8579
+ if (countryCode === 'IL') {
8580
+ this.il = true;
8581
+ }
8579
8582
  this.geoid = geoid;
8580
8583
  }
8581
8584
  /**
@@ -8615,7 +8618,7 @@ class Location extends GeoLocation {
8615
8618
  if (name[comma + 3] === 'C') {
8616
8619
  return name.substring(0, comma + 4);
8617
8620
  }
8618
- else if (name[comma + 3] === '.' && name[comma + 4] === 'C') {
8621
+ if (name[comma + 3] === '.' && name[comma + 4] === 'C') {
8619
8622
  return name.substring(0, comma + 6);
8620
8623
  }
8621
8624
  }
@@ -8712,15 +8715,13 @@ class Location extends GeoLocation {
8712
8715
  if (tz === 0) {
8713
8716
  return 'UTC';
8714
8717
  }
8715
- else {
8716
- const plus = tz > 0 ? '+' : '';
8717
- return `Etc/GMT${plus}${tz}`;
8718
- }
8718
+ const plus = tz > 0 ? '+' : '';
8719
+ return `Etc/GMT${plus}${tz}`;
8719
8720
  }
8720
- else if (tz === 2 && dst === 'israel') {
8721
+ if (tz === 2 && dst === 'israel') {
8721
8722
  return 'Asia/Jerusalem';
8722
8723
  }
8723
- else if (dst === 'eu') {
8724
+ if (dst === 'eu') {
8724
8725
  switch (tz) {
8725
8726
  case -2:
8726
8727
  return 'Atlantic/Cape_Verde';
@@ -8734,7 +8735,7 @@ class Location extends GeoLocation {
8734
8735
  return 'Europe/Athens';
8735
8736
  }
8736
8737
  }
8737
- else if (dst === 'usa') {
8738
+ if (dst === 'usa') {
8738
8739
  return ZIPCODES_TZ_MAP[String(tz * -1)];
8739
8740
  }
8740
8741
  return undefined;
@@ -8752,12 +8753,10 @@ class Location extends GeoLocation {
8752
8753
  if (tz === 10 && state === 'AK') {
8753
8754
  return 'America/Adak';
8754
8755
  }
8755
- else if (tz === 7 && state === 'AZ') {
8756
+ if (tz === 7 && state === 'AZ') {
8756
8757
  return dst === 'Y' ? 'America/Denver' : 'America/Phoenix';
8757
8758
  }
8758
- else {
8759
- return ZIPCODES_TZ_MAP[tz];
8760
- }
8759
+ return ZIPCODES_TZ_MAP[tz];
8761
8760
  }
8762
8761
  /**
8763
8762
  * Registers a new named location with the built-in `Location.lookup()`
@@ -9005,7 +9004,7 @@ function getDayNames(locale) {
9005
9004
  if (Locale.isHebrewLocale(locale)) {
9006
9005
  return heDayNames;
9007
9006
  }
9008
- else if (locale === 'fr') {
9007
+ if (locale === 'fr') {
9009
9008
  return frDoW;
9010
9009
  }
9011
9010
  return enDoW;
@@ -9013,11 +9012,11 @@ function getDayNames(locale) {
9013
9012
  function getHebrewTimeOfDay(hour) {
9014
9013
  if (hour < 5)
9015
9014
  return night;
9016
- else if (hour < 12)
9015
+ if (hour < 12)
9017
9016
  return 'בַּבֹּקֶר';
9018
- else if (hour < 17)
9017
+ if (hour < 17)
9019
9018
  return 'בַּצׇּהֳרַיִים';
9020
- else if (hour < 21)
9019
+ if (hour < 21)
9021
9020
  return 'בָּעֶרֶב';
9022
9021
  return night;
9023
9022
  }
@@ -10351,12 +10350,10 @@ function yearType(hyear) {
10351
10350
  if (longC && !shortK) {
10352
10351
  return COMPLETE;
10353
10352
  }
10354
- else if (!longC && shortK) {
10353
+ if (!longC && shortK) {
10355
10354
  return INCOMPLETE;
10356
10355
  }
10357
- else {
10358
- return REGULAR;
10359
- }
10356
+ return REGULAR;
10360
10357
  }
10361
10358
  /**
10362
10359
  * Represents the weekly Torah-reading (Parashat HaShavua) schedule for an
@@ -10439,23 +10436,21 @@ class Sedra {
10439
10436
  }
10440
10437
  return this.findInternal(parsha);
10441
10438
  }
10442
- else if (typeof parsha === 'string') {
10439
+ if (typeof parsha === 'string') {
10443
10440
  const num = parsha2id.get(parsha);
10444
10441
  if (typeof num === 'number') {
10445
10442
  return this.find(num);
10446
10443
  }
10447
- else if (parsha.includes('-')) {
10444
+ if (parsha.includes('-')) {
10448
10445
  if (parsha === CHMPESACH || parsha === CHMSUKOT) {
10449
10446
  return this.findInternal(parsha);
10450
10447
  }
10451
10448
  return this.find(parsha.split('-'));
10452
10449
  }
10453
- else {
10454
- // try to find Saturday holiday like 'Yom Kippur'
10455
- return this.findInternal(parsha);
10456
- }
10450
+ // try to find Saturday holiday like 'Yom Kippur'
10451
+ return this.findInternal(parsha);
10457
10452
  }
10458
- else if (Array.isArray(parsha)) {
10453
+ if (Array.isArray(parsha)) {
10459
10454
  const plen = parsha.length;
10460
10455
  if ((plen !== 1 && plen !== 2) || typeof parsha[0] !== 'string') {
10461
10456
  throw new TypeError(`Invalid parsha argument: ${JSON.stringify(parsha)}`);
@@ -10594,7 +10589,7 @@ class Sedra {
10594
10589
  if (isNaN(abs)) {
10595
10590
  throw new TypeError(`Bad date argument: ${hd}`);
10596
10591
  }
10597
- else if (abs < this.rh) {
10592
+ if (abs < this.rh) {
10598
10593
  throw new RangeError(`Date ${hd} before start of Hebrew year ${this.year}`);
10599
10594
  }
10600
10595
  // find the first saturday on or after today's date
@@ -10645,7 +10640,7 @@ class Sedra {
10645
10640
  if (isNaN(abs)) {
10646
10641
  throw new TypeError(`Bad date argument: ${hd}`);
10647
10642
  }
10648
- else if (abs < this.rh) {
10643
+ if (abs < this.rh) {
10649
10644
  throw new RangeError(`Date ${hd} before start of Hebrew year ${this.year}`);
10650
10645
  }
10651
10646
  const hdate = new HDate(abs);
@@ -11634,12 +11629,10 @@ class HolidayEvent extends Event {
11634
11629
  if (this.emoji) {
11635
11630
  return this.emoji;
11636
11631
  }
11637
- else if (this.getFlags() & flags.SPECIAL_SHABBAT) {
11632
+ if (this.getFlags() & flags.SPECIAL_SHABBAT) {
11638
11633
  return '🕍';
11639
11634
  }
11640
- else {
11641
- return '✡️';
11642
- }
11635
+ return '✡️';
11643
11636
  }
11644
11637
  getCategories() {
11645
11638
  if (this.cholHaMoedDay) {
@@ -11905,7 +11898,7 @@ function getHolidaysForYear_(year) {
11905
11898
  if (typeof year !== 'number') {
11906
11899
  throw new TypeError(`bad Hebrew year: ${year}`);
11907
11900
  }
11908
- else if (year < 1 || year > 32658) {
11901
+ if (year < 1 || year > 32658) {
11909
11902
  throw new RangeError(`Hebrew year ${year} out of range 1-32658`);
11910
11903
  }
11911
11904
  const cached = yearCache.get(year);
@@ -11934,11 +11927,12 @@ function getHolidaysForYear_(year) {
11934
11927
  }
11935
11928
  for (const h of staticHolidays) {
11936
11929
  const hd = new HDate(h.dd, h.mm, year);
11937
- const ev = new HolidayEvent(hd, h.desc, h.flags);
11930
+ const attrs = {};
11938
11931
  if (h.emoji)
11939
- ev.emoji = h.emoji;
11932
+ attrs.emoji = h.emoji;
11940
11933
  if (h.chmDay)
11941
- ev.cholHaMoedDay = h.chmDay;
11934
+ attrs.cholHaMoedDay = h.chmDay;
11935
+ const ev = new HolidayEvent(hd, h.desc, h.flags, attrs);
11942
11936
  add(ev);
11943
11937
  }
11944
11938
  // standard holidays that don't shift based on year
@@ -13442,10 +13436,12 @@ const MAX_NUM_YEARS = 2000;
13442
13436
  * @private
13443
13437
  */
13444
13438
  function getStartAndEnd(options) {
13445
- if ((options.start && !options.end) || (options.end && !options.start)) {
13446
- throw new TypeError('Both options.start and options.end are required');
13439
+ const hasStart = options.start !== undefined;
13440
+ const hasEnd = options.end !== undefined;
13441
+ if (hasStart !== hasEnd) {
13442
+ throw new TypeError('options.start requires options.end');
13447
13443
  }
13448
- else if (options.start && options.end) {
13444
+ if (hasStart && hasEnd) {
13449
13445
  const start = getAbs(options.start), end = getAbs(options.end);
13450
13446
  if (end - start > 365 * MAX_NUM_YEARS) {
13451
13447
  throw new RangeError(`Date range exceeds ${MAX_NUM_YEARS} years`);
@@ -13457,7 +13453,7 @@ function getStartAndEnd(options) {
13457
13453
  if (isNaN(theYear)) {
13458
13454
  throw new RangeError(`Invalid year ${options.year}`);
13459
13455
  }
13460
- else if (isHebrewYear && theYear < 1) {
13456
+ if (isHebrewYear && theYear < 1) {
13461
13457
  throw new RangeError(`Invalid Hebrew year ${theYear}`);
13462
13458
  }
13463
13459
  const theMonth = getMonth(options);
@@ -13477,7 +13473,7 @@ function getMonth(options) {
13477
13473
  if (options.isHebrewYear) {
13478
13474
  return HDate.monthNum(options.month);
13479
13475
  }
13480
- else if (typeof options.month === 'number') {
13476
+ if (typeof options.month === 'number') {
13481
13477
  return options.month;
13482
13478
  }
13483
13479
  }
@@ -13903,7 +13899,7 @@ function checkCandleOptions(options) {
13903
13899
  const min0 = options.candleLightingMins;
13904
13900
  let min = typeof min0 === 'number' && !isNaN(min0) ? Math.trunc(min0) : 18;
13905
13901
  if (location.getIsrael() && Math.abs(min) === 18) {
13906
- min = overrideIsraelCandleMins(location, min);
13902
+ min = overrideIsraelCandleMins(location);
13907
13903
  }
13908
13904
  options.candleLightingMins = -1 * Math.abs(min);
13909
13905
  if (typeof options.havdalahMins === 'number') {
@@ -13922,7 +13918,7 @@ function checkCandleOptions(options) {
13922
13918
  options.fastEndMins = Math.trunc(Math.abs(options.fastEndMins));
13923
13919
  }
13924
13920
  }
13925
- function overrideIsraelCandleMins(location, min) {
13921
+ function overrideIsraelCandleMins(location) {
13926
13922
  const geoid = location.getGeoId();
13927
13923
  if (geoid) {
13928
13924
  const offset = geoIdCandleOffset[geoid];
@@ -13937,7 +13933,7 @@ function overrideIsraelCandleMins(location, min) {
13937
13933
  return offset;
13938
13934
  }
13939
13935
  }
13940
- return min;
13936
+ return 20;
13941
13937
  }
13942
13938
  /**
13943
13939
  * Mask to filter Holiday array