@hebcal/core 3.50.3 → 3.50.4

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/README.md CHANGED
@@ -329,7 +329,7 @@ Represents a Hebrew date
329
329
  * [.abs()](#HDate+abs) ⇒ <code>number</code>
330
330
  * [.getMonthName()](#HDate+getMonthName) ⇒ <code>string</code>
331
331
  * [.render([locale], [showYear])](#HDate+render) ⇒ <code>string</code>
332
- * [.renderGematriya()](#HDate+renderGematriya) ⇒ <code>string</code>
332
+ * [.renderGematriya([suppressNikud])](#HDate+renderGematriya) ⇒ <code>string</code>
333
333
  * [.before(day)](#HDate+before) ⇒ [<code>HDate</code>](#HDate)
334
334
  * [.onOrBefore(dow)](#HDate+onOrBefore) ⇒ [<code>HDate</code>](#HDate)
335
335
  * [.nearest(dow)](#HDate+nearest) ⇒ [<code>HDate</code>](#HDate)
@@ -477,10 +477,15 @@ console.log(hd.render('he')); // '15 חֶשְׁוָן, 5769'
477
477
  ```
478
478
  <a name="HDate+renderGematriya"></a>
479
479
 
480
- ### hDate.renderGematriya() ⇒ <code>string</code>
480
+ ### hDate.renderGematriya([suppressNikud]) ⇒ <code>string</code>
481
481
  Renders this Hebrew date in Hebrew gematriya, regardless of locale.
482
482
 
483
483
  **Kind**: instance method of [<code>HDate</code>](#HDate)
484
+
485
+ | Param | Type | Default |
486
+ | --- | --- | --- |
487
+ | [suppressNikud] | <code>boolean</code> | <code>false</code> |
488
+
484
489
  **Example**
485
490
  ```js
486
491
  import {HDate, months} from '@hebcal/core';
@@ -1869,20 +1874,20 @@ Returns the Daf Yomi for given date
1869
1874
  **Kind**: global class
1870
1875
 
1871
1876
  * [DafYomi](#DafYomi)
1872
- * [new DafYomi(gregdate)](#new_DafYomi_new)
1877
+ * [new DafYomi(date)](#new_DafYomi_new)
1873
1878
  * [.getBlatt()](#DafYomi+getBlatt) ⇒ <code>number</code>
1874
1879
  * [.getName()](#DafYomi+getName) ⇒ <code>string</code>
1875
1880
  * [.render([locale])](#DafYomi+render) ⇒ <code>string</code>
1876
1881
 
1877
1882
  <a name="new_DafYomi_new"></a>
1878
1883
 
1879
- ### new DafYomi(gregdate)
1884
+ ### new DafYomi(date)
1880
1885
  Initializes a daf yomi instance
1881
1886
 
1882
1887
 
1883
1888
  | Param | Type | Description |
1884
1889
  | --- | --- | --- |
1885
- | gregdate | <code>Date</code> \| [<code>HDate</code>](#HDate) \| <code>number</code> | Gregorian date |
1890
+ | date | <code>Date</code> \| [<code>HDate</code>](#HDate) \| <code>number</code> | Gregorian or Hebrew date |
1886
1891
 
1887
1892
  <a name="DafYomi+getBlatt"></a>
1888
1893
 
package/dist/bundle.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v3.50.3 */
1
+ /*! @hebcal/core v3.50.4 */
2
2
  var hebcal = (function (exports) {
3
3
  'use strict';
4
4
 
@@ -450,10 +450,10 @@ var store$2 = sharedStore;
450
450
  (shared$3.exports = function (key, value) {
451
451
  return store$2[key] || (store$2[key] = value !== undefined ? value : {});
452
452
  })('versions', []).push({
453
- version: '3.27.2',
453
+ version: '3.29.1',
454
454
  mode: 'global',
455
455
  copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
456
- license: 'https://github.com/zloirock/core-js/blob/v3.27.2/LICENSE',
456
+ license: 'https://github.com/zloirock/core-js/blob/v3.29.1/LICENSE',
457
457
  source: 'https://github.com/zloirock/core-js'
458
458
  });
459
459
 
@@ -2675,11 +2675,14 @@ var HDate = /*#__PURE__*/function () {
2675
2675
  * import {HDate, months} from '@hebcal/core';
2676
2676
  * const hd = new HDate(15, months.CHESHVAN, 5769);
2677
2677
  * console.log(hd.renderGematriya()); // 'ט״ו חֶשְׁוָן תשס״ט'
2678
+ * @param {boolean} [suppressNikud]
2678
2679
  * @return {string}
2679
2680
  */
2680
2681
  function renderGematriya() {
2682
+ var suppressNikud = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
2681
2683
  var d = this.getDate();
2682
- var m = Locale.gettext(this.getMonthName(), 'he');
2684
+ var locale = suppressNikud ? 'he-x-NoNikud' : 'he';
2685
+ var m = Locale.gettext(this.getMonthName(), locale);
2683
2686
  var y = this.getFullYear();
2684
2687
  return gematriya(d) + ' ' + m + ' ' + gematriya(y);
2685
2688
  }
@@ -5189,16 +5192,15 @@ var toString$2 = toString$4;
5189
5192
  var whitespaces$1 = whitespaces$2;
5190
5193
 
5191
5194
  var replace = uncurryThis$4(''.replace);
5192
- var whitespace = '[' + whitespaces$1 + ']';
5193
- var ltrim = RegExp('^' + whitespace + whitespace + '*');
5194
- var rtrim = RegExp(whitespace + whitespace + '*$');
5195
+ var ltrim = RegExp('^[' + whitespaces$1 + ']+');
5196
+ var rtrim = RegExp('(^|[^' + whitespaces$1 + '])[' + whitespaces$1 + ']+$');
5195
5197
 
5196
5198
  // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
5197
5199
  var createMethod = function (TYPE) {
5198
5200
  return function ($this) {
5199
5201
  var string = toString$2(requireObjectCoercible$2($this));
5200
5202
  if (TYPE & 1) string = replace(string, ltrim, '');
5201
- if (TYPE & 2) string = replace(string, rtrim, '');
5203
+ if (TYPE & 2) string = replace(string, rtrim, '$1');
5202
5204
  return string;
5203
5205
  };
5204
5206
  };
@@ -5473,13 +5475,13 @@ var shas0 = [['Berachot', 64], ['Shabbat', 157], ['Eruvin', 105], ['Pesachim', 1
5473
5475
  var DafYomi = /*#__PURE__*/function () {
5474
5476
  /**
5475
5477
  * Initializes a daf yomi instance
5476
- * @param {Date|HDate|number} gregdate Gregorian date
5478
+ * @param {Date|HDate|number} date Gregorian or Hebrew date
5477
5479
  */
5478
- function DafYomi(gregdate) {
5480
+ function DafYomi(date) {
5479
5481
  _classCallCheck(this, DafYomi);
5480
- var cday = typeof gregdate === 'number' && !isNaN(gregdate) ? gregdate : isDate(gregdate) ? greg2abs(gregdate) : HDate.isHDate(gregdate) ? gregdate.abs() : throwTypeError("non-date given to dafyomi: ".concat(gregdate));
5482
+ var cday = typeof date === 'number' && !isNaN(date) ? date : isDate(date) ? greg2abs(date) : HDate.isHDate(date) ? date.abs() : throwTypeError("non-date given to dafyomi: ".concat(date));
5481
5483
  if (cday < osday) {
5482
- throw new RangeError("Date ".concat(gregdate, " too early; Daf Yomi cycle began on ").concat(osdate));
5484
+ throw new RangeError("Date ".concat(date, " too early; Daf Yomi cycle began on ").concat(osdate));
5483
5485
  }
5484
5486
  var cno;
5485
5487
  var dno;
@@ -7971,7 +7973,9 @@ function getYahrzeit_(hyear, gdate) {
7971
7973
  function getBirthdayOrAnniversary_(hyear, gdate) {
7972
7974
  var orig = HDate.isHDate(gdate) ? gdate : new HDate(gdate);
7973
7975
  var origYear = orig.getFullYear();
7974
- if (hyear <= origYear) {
7976
+ if (hyear === origYear) {
7977
+ return orig;
7978
+ } else if (hyear < origYear) {
7975
7979
  // `Hebrew year ${hyear} occurs on or before original date in ${origYear}`
7976
7980
  return undefined;
7977
7981
  }
@@ -7993,7 +7997,7 @@ function getBirthdayOrAnniversary_(hyear, gdate) {
7993
7997
  return new HDate(day, month, hyear);
7994
7998
  }
7995
7999
 
7996
- var version="3.50.3";
8000
+ var version="3.50.4";
7997
8001
 
7998
8002
  var headers$1={"plural-forms":"nplurals=2; plural=(n > 1);"};var contexts$1={"":{Berachot:["Berachos"],Shabbat:["Shabbos"],Taanit:["Taanis"],Yevamot:["Yevamos"],Ketubot:["Kesubos"],"Baba Batra":["Baba Basra"],Makkot:["Makkos"],Shevuot:["Shevuos"],Horayot:["Horayos"],Menachot:["Menachos"],Bechorot:["Bechoros"],Keritot:["Kerisos"],Midot:["Midos"],"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"],Tazria:["Sazria"],"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"],Berakhot:["Berakhos"],Sheviit:["Sheviis"],Terumot:["Terumos"],Maasrot:["Maasros"],Eduyot:["Eduyos"],Avot:["Avos"],Bekhorot:["Bekhoros"],Middot:["Middos"],Oholot:["Oholos"],Tahorot:["Tahoros"],Mikvaot:["Mikvaos"],"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};
7999
8003
 
@@ -8241,6 +8245,7 @@ var addToUnscopables = addToUnscopables$1;
8241
8245
 
8242
8246
  // FF99+ bug
8243
8247
  var BROKEN_ON_SPARSE = fails(function () {
8248
+ // eslint-disable-next-line es/no-array-prototype-includes -- detection
8244
8249
  return !Array(1).includes();
8245
8250
  });
8246
8251