@hebcal/core 5.0.0 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v5.0.0 */
1
+ /*! @hebcal/core v5.0.1 */
2
2
  'use strict';
3
3
 
4
4
  const GERESH = '׳';
@@ -28,10 +28,9 @@ const heb2num = {
28
28
  'ת': 400
29
29
  };
30
30
  const num2heb = new Map();
31
- Object.keys(heb2num).forEach(key => {
32
- const val = heb2num[key];
31
+ for (const [key, val] of Object.entries(heb2num)) {
33
32
  num2heb.set(val, key);
34
- });
33
+ }
35
34
 
36
35
  /**
37
36
  * @private
@@ -251,9 +250,7 @@ class Locale {
251
250
  throw new TypeError(`Locale '${locale}' invalid compact format`);
252
251
  }
253
252
  const ctx = data.contexts[''];
254
- Object.keys(ctx).forEach(id => {
255
- loc[id] = ctx[id];
256
- });
253
+ Object.assign(loc, ctx);
257
254
  }
258
255
  /**
259
256
  * Activates a locale. Throws an error if the locale has not been previously added.
@@ -1837,7 +1834,7 @@ class Event {
1837
1834
  this.desc = desc;
1838
1835
  this.mask = +mask;
1839
1836
  if (typeof attrs === 'object' && attrs !== null) {
1840
- Object.keys(attrs).forEach(k => this[k] = attrs[k]);
1837
+ Object.assign(this, attrs);
1841
1838
  }
1842
1839
  }
1843
1840
  /**
@@ -3430,10 +3427,10 @@ class Location extends GeoLocation {
3430
3427
  return true;
3431
3428
  }
3432
3429
  }
3433
- classicCities0.forEach(city => {
3430
+ for (const city of classicCities0) {
3434
3431
  const location = new Location(city[2], city[3], city[1] == 'IL', city[4], city[0], city[1], undefined, city[5]);
3435
3432
  Location.addLocation(location.getName(), location);
3436
- });
3433
+ }
3437
3434
 
3438
3435
  const _formatters = new Map();
3439
3436
 
@@ -5612,40 +5609,7 @@ const MINOR_HOLIDAY$1 = flags.MINOR_HOLIDAY;
5612
5609
  const EREV$1 = flags.EREV;
5613
5610
  // const CHOL_HAMOED = flags.CHOL_HAMOED;
5614
5611
 
5615
- /**
5616
- * Avoid dependency on ES6 Map object
5617
- * @private
5618
- */
5619
- class SimpleMap {
5620
- /**
5621
- * @param {string} key
5622
- * @return {boolean}
5623
- */
5624
- has(key) {
5625
- return typeof this[key] !== 'undefined';
5626
- }
5627
- /**
5628
- * @param {string} key
5629
- * @return {any}
5630
- */
5631
- get(key) {
5632
- return this[key];
5633
- }
5634
- /**
5635
- * @param {string} key
5636
- * @param {any} val
5637
- */
5638
- set(key, val) {
5639
- this[key] = val;
5640
- }
5641
- /**
5642
- * @return {string[]}
5643
- */
5644
- keys() {
5645
- return Object.keys(this);
5646
- }
5647
- }
5648
- const sedraCache = new SimpleMap();
5612
+ const sedraCache = new Map();
5649
5613
 
5650
5614
  /**
5651
5615
  * @private
@@ -5689,13 +5653,12 @@ function getHolidaysForYear_(year) {
5689
5653
  }
5690
5654
  const RH = new HDate(1, TISHREI$1, year);
5691
5655
  const pesach = new HDate(15, NISAN$1, year);
5692
- const h = new SimpleMap();
5656
+ const map = new Map();
5693
5657
  // eslint-disable-next-line require-jsdoc
5694
5658
  function add(...events) {
5695
- // for (const ev of events) {
5696
- events.forEach(ev => {
5659
+ for (const ev of events) {
5697
5660
  const key = ev.date.toString();
5698
- const arr = h.get(key);
5661
+ const arr = map.get(key);
5699
5662
  if (typeof arr === 'object') {
5700
5663
  if (arr[0].getFlags() & flags.EREV) {
5701
5664
  arr.unshift(ev);
@@ -5703,17 +5666,17 @@ function getHolidaysForYear_(year) {
5703
5666
  arr.push(ev);
5704
5667
  }
5705
5668
  } else {
5706
- h.set(key, [ev]);
5669
+ map.set(key, [ev]);
5707
5670
  }
5708
- });
5671
+ }
5709
5672
  }
5710
- staticHolidays.forEach(h => {
5673
+ for (const h of staticHolidays) {
5711
5674
  const hd = new HDate(h.dd, h.mm, year);
5712
5675
  const ev = new HolidayEvent(hd, h.desc, h.flags);
5713
5676
  if (h.emoji) ev.emoji = h.emoji;
5714
5677
  if (h.chmDay) ev.cholHaMoedDay = h.chmDay;
5715
5678
  add(ev);
5716
- });
5679
+ }
5717
5680
 
5718
5681
  // standard holidays that don't shift based on year
5719
5682
  add(new RoshHashanaEvent(RH, year, CHAG | LIGHT_CANDLES_TZEIS$1));
@@ -5765,7 +5728,7 @@ function getHolidaysForYear_(year) {
5765
5728
  if (yomHaZikaronDt) {
5766
5729
  add(new HolidayEvent(yomHaZikaronDt, 'Yom HaZikaron', MODERN_HOLIDAY$1, emojiIsraelFlag), new HolidayEvent(yomHaZikaronDt.next(), 'Yom HaAtzma\'ut', MODERN_HOLIDAY$1, emojiIsraelFlag));
5767
5730
  }
5768
- staticModernHolidays.forEach(h => {
5731
+ for (const h of staticModernHolidays) {
5769
5732
  if (year >= h.firstYear) {
5770
5733
  let hd = new HDate(h.dd, h.mm, year);
5771
5734
  const dow = hd.getDay();
@@ -5783,7 +5746,7 @@ function getHolidaysForYear_(year) {
5783
5746
  }
5784
5747
  add(ev);
5785
5748
  }
5786
- });
5749
+ }
5787
5750
  let tamuz17 = new HDate(17, TAMUZ, year);
5788
5751
  let tamuz17attrs;
5789
5752
  if (tamuz17.getDay() == SAT$1) {
@@ -5854,8 +5817,8 @@ function getHolidaysForYear_(year) {
5854
5817
  emoji: '☀️'
5855
5818
  }));
5856
5819
  }
5857
- yearCache.set(year, h);
5858
- return h;
5820
+ yearCache.set(year, map);
5821
+ return map;
5859
5822
  }
5860
5823
 
5861
5824
  /**
@@ -5922,7 +5885,7 @@ class DailyLearning {
5922
5885
  }
5923
5886
  }
5924
5887
 
5925
- const version="5.0.0";
5888
+ const version="5.0.1";
5926
5889
 
5927
5890
  const headers$1={"plural-forms":"nplurals=2; plural=(n > 1);"};const contexts$1={"":{Shabbat:["Shabbos"],"Achrei Mot":["Achrei Mos"],Bechukotai:["Bechukosai"],"Beha'alotcha":["Beha'aloscha"],Bereshit:["Bereshis"],Chukat:["Chukas"],"Erev Shavuot":["Erev Shavuos"],"Erev Sukkot":["Erev Sukkos"],"Ki Tavo":["Ki Savo"],"Ki Teitzei":["Ki Seitzei"],"Ki Tisa":["Ki Sisa"],Matot:["Matos"],"Purim Katan":["Purim Koton"],"Shabbat Chazon":["Shabbos Chazon"],"Shabbat HaChodesh":["Shabbos HaChodesh"],"Shabbat HaGadol":["Shabbos HaGadol"],"Shabbat Nachamu":["Shabbos Nachamu"],"Shabbat Parah":["Shabbos Parah"],"Shabbat Shekalim":["Shabbos Shekalim"],"Shabbat Shuva":["Shabbos Shuvah"],"Shabbat Zachor":["Shabbos Zachor"],Shavuot:["Shavuos"],"Shavuot I":["Shavuos I"],"Shavuot II":["Shavuos II"],Shemot:["Shemos"],"Shmini Atzeret":["Shmini Atzeres"],"Simchat Torah":["Simchas Torah"],Sukkot:["Sukkos"],"Sukkot I":["Sukkos I"],"Sukkot II":["Sukkos II"],"Sukkot II (CH''M)":["Sukkos II (CH''M)"],"Sukkot III (CH''M)":["Sukkos III (CH''M)"],"Sukkot IV (CH''M)":["Sukkos IV (CH''M)"],"Sukkot V (CH''M)":["Sukkos V (CH''M)"],"Sukkot VI (CH''M)":["Sukkos VI (CH''M)"],"Sukkot VII (Hoshana Raba)":["Sukkos VII (Hoshana Raba)"],"Ta'anit Bechorot":["Ta'anis Bechoros"],"Ta'anit Esther":["Ta'anis Esther"],Toldot:["Toldos"],Vaetchanan:["Vaeschanan"],Yitro:["Yisro"],"Vezot Haberakhah":["Vezos Haberakhah"],Parashat:["Parshas"],"Leil Selichot":["Leil Selichos"],"Shabbat Mevarchim Chodesh":["Shabbos Mevorchim Chodesh"],"Shabbat Shirah":["Shabbos Shirah"],Tevet:["Teves"],"Asara B'Tevet":["Asara B'Teves"],"Alot HaShachar":["Alos HaShachar"],"Kriat Shema, sof zeman":["Krias Shema, sof zman"],"Tefilah, sof zeman":["Tefilah, sof zman"],"Kriat Shema, sof zeman (MGA)":["Krias Shema, sof zman (MGA)"],"Tefilah, sof zeman (MGA)":["Tefilah, sof zman (MGA)"],"Chatzot HaLailah":["Chatzos HaLailah"],"Chatzot hayom":["Chatzos"],"Tzeit HaKochavim":["Tzeis HaKochavim"],"Birkat Hachamah":["Birkas Hachamah"],"Shushan Purim Katan":["Shushan Purim Koton"]}};var poAshkenazi = {headers:headers$1,contexts:contexts$1};
5928
5891
 
@@ -5935,9 +5898,9 @@ Locale.addLocale('he', poHe);
5935
5898
  Locale.addLocale('h', poHe);
5936
5899
  const heStrs = poHe.contexts[''];
5937
5900
  const heNoNikud = {};
5938
- Object.keys(heStrs).forEach(key => {
5939
- heNoNikud[key] = [Locale.hebrewStripNikkud(heStrs[key][0])];
5940
- });
5901
+ for (const [key, val] of Object.entries(heStrs)) {
5902
+ heNoNikud[key] = [Locale.hebrewStripNikkud(val[0])];
5903
+ }
5941
5904
  const poHeNoNikud = {
5942
5905
  headers: poHe.headers,
5943
5906
  contexts: {
@@ -6218,24 +6181,12 @@ const RECOGNIZED_OPTIONS = {
6218
6181
  * @param {CalOptions} options
6219
6182
  */
6220
6183
  function warnUnrecognizedOptions(options) {
6221
- Object.keys(options).forEach(k => {
6184
+ for (const k of Object.keys(options)) {
6222
6185
  if (typeof RECOGNIZED_OPTIONS[k] === 'undefined' && !unrecognizedAlreadyWarned.has(k)) {
6223
6186
  console.warn(`Ignoring unrecognized HebrewCalendar option: ${k}`);
6224
6187
  unrecognizedAlreadyWarned.add(k);
6225
6188
  }
6226
- });
6227
- }
6228
-
6229
- /**
6230
- * A bit like Object.assign(), but just a shallow copy
6231
- * @private
6232
- * @param {any} target
6233
- * @param {any} source
6234
- * @return {any}
6235
- */
6236
- function shallowCopy(target, source) {
6237
- Object.keys(source).forEach(k => target[k] = source[k]);
6238
- return target;
6189
+ }
6239
6190
  }
6240
6191
  const israelCityOffset = {
6241
6192
  'Jerusalem': 40,
@@ -6713,7 +6664,7 @@ class HebrewCalendar {
6713
6664
  * @return {Event[]}
6714
6665
  */
6715
6666
  static calendar(options = {}) {
6716
- options = shallowCopy({}, options); // so we can modify freely
6667
+ options = Object.assign({}, options); // so we can modify freely
6717
6668
  checkCandleOptions(options);
6718
6669
  const location = options.location = options.location || defaultLocation;
6719
6670
  const il = options.il = options.il || location.il || false;
@@ -6762,9 +6713,9 @@ class HebrewCalendar {
6762
6713
  const dow = hd.getDay();
6763
6714
  let candlesEv;
6764
6715
  const ev = holidaysYear.get(hd.toString()) || [];
6765
- ev.forEach(e => {
6716
+ for (const e of ev) {
6766
6717
  candlesEv = appendHolidayAndRelated(evts, e, options, candlesEv, dow);
6767
- });
6718
+ }
6768
6719
  if (options.sedrot && dow === SAT) {
6769
6720
  const parsha0 = sedra.lookup(abs);
6770
6721
  if (!parsha0.chag) {
@@ -6773,8 +6724,7 @@ class HebrewCalendar {
6773
6724
  }
6774
6725
  const dailyLearning = options.dailyLearning;
6775
6726
  if (typeof dailyLearning === 'object') {
6776
- Object.keys(dailyLearning).forEach(key => {
6777
- const val = dailyLearning[key];
6727
+ for (const [key, val] of Object.entries(dailyLearning)) {
6778
6728
  if (val) {
6779
6729
  const name = key === 'yerushalmi' ? val === 2 ? 'yerushalmi-schottenstein' : 'yerushalmi-vilna' : key;
6780
6730
  const learningEv = DailyLearning.lookup(name, hd);
@@ -6782,7 +6732,7 @@ class HebrewCalendar {
6782
6732
  evts.push(learningEv);
6783
6733
  }
6784
6734
  }
6785
- });
6735
+ }
6786
6736
  }
6787
6737
  if (options.omer && abs >= beginOmer && abs <= endOmer) {
6788
6738
  const omer = abs - beginOmer + 1;
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v5.0.0 */
1
+ /*! @hebcal/core v5.0.1 */
2
2
  const GERESH = '׳';
3
3
  const GERSHAYIM = '״';
4
4
  const heb2num = {
@@ -26,10 +26,9 @@ const heb2num = {
26
26
  'ת': 400
27
27
  };
28
28
  const num2heb = new Map();
29
- Object.keys(heb2num).forEach(key => {
30
- const val = heb2num[key];
29
+ for (const [key, val] of Object.entries(heb2num)) {
31
30
  num2heb.set(val, key);
32
- });
31
+ }
33
32
 
34
33
  /**
35
34
  * @private
@@ -249,9 +248,7 @@ class Locale {
249
248
  throw new TypeError(`Locale '${locale}' invalid compact format`);
250
249
  }
251
250
  const ctx = data.contexts[''];
252
- Object.keys(ctx).forEach(id => {
253
- loc[id] = ctx[id];
254
- });
251
+ Object.assign(loc, ctx);
255
252
  }
256
253
  /**
257
254
  * Activates a locale. Throws an error if the locale has not been previously added.
@@ -1835,7 +1832,7 @@ class Event {
1835
1832
  this.desc = desc;
1836
1833
  this.mask = +mask;
1837
1834
  if (typeof attrs === 'object' && attrs !== null) {
1838
- Object.keys(attrs).forEach(k => this[k] = attrs[k]);
1835
+ Object.assign(this, attrs);
1839
1836
  }
1840
1837
  }
1841
1838
  /**
@@ -3428,10 +3425,10 @@ class Location extends GeoLocation {
3428
3425
  return true;
3429
3426
  }
3430
3427
  }
3431
- classicCities0.forEach(city => {
3428
+ for (const city of classicCities0) {
3432
3429
  const location = new Location(city[2], city[3], city[1] == 'IL', city[4], city[0], city[1], undefined, city[5]);
3433
3430
  Location.addLocation(location.getName(), location);
3434
- });
3431
+ }
3435
3432
 
3436
3433
  const _formatters = new Map();
3437
3434
 
@@ -5610,40 +5607,7 @@ const MINOR_HOLIDAY$1 = flags.MINOR_HOLIDAY;
5610
5607
  const EREV$1 = flags.EREV;
5611
5608
  // const CHOL_HAMOED = flags.CHOL_HAMOED;
5612
5609
 
5613
- /**
5614
- * Avoid dependency on ES6 Map object
5615
- * @private
5616
- */
5617
- class SimpleMap {
5618
- /**
5619
- * @param {string} key
5620
- * @return {boolean}
5621
- */
5622
- has(key) {
5623
- return typeof this[key] !== 'undefined';
5624
- }
5625
- /**
5626
- * @param {string} key
5627
- * @return {any}
5628
- */
5629
- get(key) {
5630
- return this[key];
5631
- }
5632
- /**
5633
- * @param {string} key
5634
- * @param {any} val
5635
- */
5636
- set(key, val) {
5637
- this[key] = val;
5638
- }
5639
- /**
5640
- * @return {string[]}
5641
- */
5642
- keys() {
5643
- return Object.keys(this);
5644
- }
5645
- }
5646
- const sedraCache = new SimpleMap();
5610
+ const sedraCache = new Map();
5647
5611
 
5648
5612
  /**
5649
5613
  * @private
@@ -5687,13 +5651,12 @@ function getHolidaysForYear_(year) {
5687
5651
  }
5688
5652
  const RH = new HDate(1, TISHREI$1, year);
5689
5653
  const pesach = new HDate(15, NISAN$1, year);
5690
- const h = new SimpleMap();
5654
+ const map = new Map();
5691
5655
  // eslint-disable-next-line require-jsdoc
5692
5656
  function add(...events) {
5693
- // for (const ev of events) {
5694
- events.forEach(ev => {
5657
+ for (const ev of events) {
5695
5658
  const key = ev.date.toString();
5696
- const arr = h.get(key);
5659
+ const arr = map.get(key);
5697
5660
  if (typeof arr === 'object') {
5698
5661
  if (arr[0].getFlags() & flags.EREV) {
5699
5662
  arr.unshift(ev);
@@ -5701,17 +5664,17 @@ function getHolidaysForYear_(year) {
5701
5664
  arr.push(ev);
5702
5665
  }
5703
5666
  } else {
5704
- h.set(key, [ev]);
5667
+ map.set(key, [ev]);
5705
5668
  }
5706
- });
5669
+ }
5707
5670
  }
5708
- staticHolidays.forEach(h => {
5671
+ for (const h of staticHolidays) {
5709
5672
  const hd = new HDate(h.dd, h.mm, year);
5710
5673
  const ev = new HolidayEvent(hd, h.desc, h.flags);
5711
5674
  if (h.emoji) ev.emoji = h.emoji;
5712
5675
  if (h.chmDay) ev.cholHaMoedDay = h.chmDay;
5713
5676
  add(ev);
5714
- });
5677
+ }
5715
5678
 
5716
5679
  // standard holidays that don't shift based on year
5717
5680
  add(new RoshHashanaEvent(RH, year, CHAG | LIGHT_CANDLES_TZEIS$1));
@@ -5763,7 +5726,7 @@ function getHolidaysForYear_(year) {
5763
5726
  if (yomHaZikaronDt) {
5764
5727
  add(new HolidayEvent(yomHaZikaronDt, 'Yom HaZikaron', MODERN_HOLIDAY$1, emojiIsraelFlag), new HolidayEvent(yomHaZikaronDt.next(), 'Yom HaAtzma\'ut', MODERN_HOLIDAY$1, emojiIsraelFlag));
5765
5728
  }
5766
- staticModernHolidays.forEach(h => {
5729
+ for (const h of staticModernHolidays) {
5767
5730
  if (year >= h.firstYear) {
5768
5731
  let hd = new HDate(h.dd, h.mm, year);
5769
5732
  const dow = hd.getDay();
@@ -5781,7 +5744,7 @@ function getHolidaysForYear_(year) {
5781
5744
  }
5782
5745
  add(ev);
5783
5746
  }
5784
- });
5747
+ }
5785
5748
  let tamuz17 = new HDate(17, TAMUZ, year);
5786
5749
  let tamuz17attrs;
5787
5750
  if (tamuz17.getDay() == SAT$1) {
@@ -5852,8 +5815,8 @@ function getHolidaysForYear_(year) {
5852
5815
  emoji: '☀️'
5853
5816
  }));
5854
5817
  }
5855
- yearCache.set(year, h);
5856
- return h;
5818
+ yearCache.set(year, map);
5819
+ return map;
5857
5820
  }
5858
5821
 
5859
5822
  /**
@@ -5920,7 +5883,7 @@ class DailyLearning {
5920
5883
  }
5921
5884
  }
5922
5885
 
5923
- const version="5.0.0";
5886
+ const version="5.0.1";
5924
5887
 
5925
5888
  const headers$1={"plural-forms":"nplurals=2; plural=(n > 1);"};const contexts$1={"":{Shabbat:["Shabbos"],"Achrei Mot":["Achrei Mos"],Bechukotai:["Bechukosai"],"Beha'alotcha":["Beha'aloscha"],Bereshit:["Bereshis"],Chukat:["Chukas"],"Erev Shavuot":["Erev Shavuos"],"Erev Sukkot":["Erev Sukkos"],"Ki Tavo":["Ki Savo"],"Ki Teitzei":["Ki Seitzei"],"Ki Tisa":["Ki Sisa"],Matot:["Matos"],"Purim Katan":["Purim Koton"],"Shabbat Chazon":["Shabbos Chazon"],"Shabbat HaChodesh":["Shabbos HaChodesh"],"Shabbat HaGadol":["Shabbos HaGadol"],"Shabbat Nachamu":["Shabbos Nachamu"],"Shabbat Parah":["Shabbos Parah"],"Shabbat Shekalim":["Shabbos Shekalim"],"Shabbat Shuva":["Shabbos Shuvah"],"Shabbat Zachor":["Shabbos Zachor"],Shavuot:["Shavuos"],"Shavuot I":["Shavuos I"],"Shavuot II":["Shavuos II"],Shemot:["Shemos"],"Shmini Atzeret":["Shmini Atzeres"],"Simchat Torah":["Simchas Torah"],Sukkot:["Sukkos"],"Sukkot I":["Sukkos I"],"Sukkot II":["Sukkos II"],"Sukkot II (CH''M)":["Sukkos II (CH''M)"],"Sukkot III (CH''M)":["Sukkos III (CH''M)"],"Sukkot IV (CH''M)":["Sukkos IV (CH''M)"],"Sukkot V (CH''M)":["Sukkos V (CH''M)"],"Sukkot VI (CH''M)":["Sukkos VI (CH''M)"],"Sukkot VII (Hoshana Raba)":["Sukkos VII (Hoshana Raba)"],"Ta'anit Bechorot":["Ta'anis Bechoros"],"Ta'anit Esther":["Ta'anis Esther"],Toldot:["Toldos"],Vaetchanan:["Vaeschanan"],Yitro:["Yisro"],"Vezot Haberakhah":["Vezos Haberakhah"],Parashat:["Parshas"],"Leil Selichot":["Leil Selichos"],"Shabbat Mevarchim Chodesh":["Shabbos Mevorchim Chodesh"],"Shabbat Shirah":["Shabbos Shirah"],Tevet:["Teves"],"Asara B'Tevet":["Asara B'Teves"],"Alot HaShachar":["Alos HaShachar"],"Kriat Shema, sof zeman":["Krias Shema, sof zman"],"Tefilah, sof zeman":["Tefilah, sof zman"],"Kriat Shema, sof zeman (MGA)":["Krias Shema, sof zman (MGA)"],"Tefilah, sof zeman (MGA)":["Tefilah, sof zman (MGA)"],"Chatzot HaLailah":["Chatzos HaLailah"],"Chatzot hayom":["Chatzos"],"Tzeit HaKochavim":["Tzeis HaKochavim"],"Birkat Hachamah":["Birkas Hachamah"],"Shushan Purim Katan":["Shushan Purim Koton"]}};var poAshkenazi = {headers:headers$1,contexts:contexts$1};
5926
5889
 
@@ -5933,9 +5896,9 @@ Locale.addLocale('he', poHe);
5933
5896
  Locale.addLocale('h', poHe);
5934
5897
  const heStrs = poHe.contexts[''];
5935
5898
  const heNoNikud = {};
5936
- Object.keys(heStrs).forEach(key => {
5937
- heNoNikud[key] = [Locale.hebrewStripNikkud(heStrs[key][0])];
5938
- });
5899
+ for (const [key, val] of Object.entries(heStrs)) {
5900
+ heNoNikud[key] = [Locale.hebrewStripNikkud(val[0])];
5901
+ }
5939
5902
  const poHeNoNikud = {
5940
5903
  headers: poHe.headers,
5941
5904
  contexts: {
@@ -6216,24 +6179,12 @@ const RECOGNIZED_OPTIONS = {
6216
6179
  * @param {CalOptions} options
6217
6180
  */
6218
6181
  function warnUnrecognizedOptions(options) {
6219
- Object.keys(options).forEach(k => {
6182
+ for (const k of Object.keys(options)) {
6220
6183
  if (typeof RECOGNIZED_OPTIONS[k] === 'undefined' && !unrecognizedAlreadyWarned.has(k)) {
6221
6184
  console.warn(`Ignoring unrecognized HebrewCalendar option: ${k}`);
6222
6185
  unrecognizedAlreadyWarned.add(k);
6223
6186
  }
6224
- });
6225
- }
6226
-
6227
- /**
6228
- * A bit like Object.assign(), but just a shallow copy
6229
- * @private
6230
- * @param {any} target
6231
- * @param {any} source
6232
- * @return {any}
6233
- */
6234
- function shallowCopy(target, source) {
6235
- Object.keys(source).forEach(k => target[k] = source[k]);
6236
- return target;
6187
+ }
6237
6188
  }
6238
6189
  const israelCityOffset = {
6239
6190
  'Jerusalem': 40,
@@ -6711,7 +6662,7 @@ class HebrewCalendar {
6711
6662
  * @return {Event[]}
6712
6663
  */
6713
6664
  static calendar(options = {}) {
6714
- options = shallowCopy({}, options); // so we can modify freely
6665
+ options = Object.assign({}, options); // so we can modify freely
6715
6666
  checkCandleOptions(options);
6716
6667
  const location = options.location = options.location || defaultLocation;
6717
6668
  const il = options.il = options.il || location.il || false;
@@ -6760,9 +6711,9 @@ class HebrewCalendar {
6760
6711
  const dow = hd.getDay();
6761
6712
  let candlesEv;
6762
6713
  const ev = holidaysYear.get(hd.toString()) || [];
6763
- ev.forEach(e => {
6714
+ for (const e of ev) {
6764
6715
  candlesEv = appendHolidayAndRelated(evts, e, options, candlesEv, dow);
6765
- });
6716
+ }
6766
6717
  if (options.sedrot && dow === SAT) {
6767
6718
  const parsha0 = sedra.lookup(abs);
6768
6719
  if (!parsha0.chag) {
@@ -6771,8 +6722,7 @@ class HebrewCalendar {
6771
6722
  }
6772
6723
  const dailyLearning = options.dailyLearning;
6773
6724
  if (typeof dailyLearning === 'object') {
6774
- Object.keys(dailyLearning).forEach(key => {
6775
- const val = dailyLearning[key];
6725
+ for (const [key, val] of Object.entries(dailyLearning)) {
6776
6726
  if (val) {
6777
6727
  const name = key === 'yerushalmi' ? val === 2 ? 'yerushalmi-schottenstein' : 'yerushalmi-vilna' : key;
6778
6728
  const learningEv = DailyLearning.lookup(name, hd);
@@ -6780,7 +6730,7 @@ class HebrewCalendar {
6780
6730
  evts.push(learningEv);
6781
6731
  }
6782
6732
  }
6783
- });
6733
+ }
6784
6734
  }
6785
6735
  if (options.omer && abs >= beginOmer && abs <= endOmer) {
6786
6736
  const omer = abs - beginOmer + 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hebcal/core",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "author": "Michael J. Radwin (https://github.com/mjradwin)",
5
5
  "contributors": [
6
6
  "Eyal Schachter (https://github.com/Scimonster)",
@@ -80,7 +80,7 @@
80
80
  "jsdoc": "^4.0.2",
81
81
  "jsdoc-to-markdown": "^8.0.0",
82
82
  "nyc": "^15.1.0",
83
- "rollup": "^4.6.1",
83
+ "rollup": "^4.7.0",
84
84
  "ttag-cli": "^1.10.9"
85
85
  }
86
86
  }