@hebcal/leyning 9.2.5 → 9.3.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.
package/dist/bundle.js CHANGED
@@ -1,20 +1,14 @@
1
- /*! @hebcal/leyning v9.2.5 */
1
+ /*! @hebcal/leyning v9.3.0 */
2
2
  var hebcal__leyning = (function (exports, locale, event, holidays, sedra, ParshaEvent) {
3
3
  'use strict';
4
4
 
5
5
  var poHe$1 = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);", "language": "he_IL" }, "contexts": { "": { "Shabbat Machar Chodesh": ["שַׁבָּת מָחָר חוֹדֶשׁ"], "Shabbat Rosh Chodesh": ["שַׁבָּת רֹאשׁ חוֹדֶשׁ"], "Pesach I (on Shabbat)": ["פֶּסַח יוֹם א׳ (בְּשַׁבָּת)"], "Pesach Chol ha-Moed Day 1": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם א׳"], "Pesach Chol ha-Moed Day 2": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם ב׳"], "Pesach Chol ha-Moed Day 2 on Sunday": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם ב׳ (בְּיוֹם רִאשׁוֹן)"], "Pesach Chol ha-Moed Day 3": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם ג׳"], "Pesach Chol ha-Moed Day 3 on Monday": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם ג׳ (בְּיוֹם שָׁנִי)"], "Pesach Chol ha-Moed Day 4": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם ד׳"], "Pesach Chol ha-Moed Day 5": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם ה׳"], "Pesach Shabbat Chol ha-Moed": ["פֶּסַח שַׁבָּת חוֹל הַמּוֹעֵד"], "Pesach VII (on Shabbat)": ["פֶּסַח ז׳ (בְּשַׁבָּת)"], "Pesach VIII (on Shabbat)": ["פֶּסַח ח׳ (בְּשַׁבָּת)"], "Shavuot II (on Shabbat)": ["שָׁבוּעוֹת יוֹם ב׳ (בְּשַׁבָּת)"], "Rosh Hashana I (on Shabbat)": ["רֹאשׁ הַשָּׁנָה יוֹם א׳ (בְּשַׁבָּת)"], "Yom Kippur (on Shabbat)": ["יוֹם כִּפּוּר (בְּשַׁבָּת)"], "Yom Kippur (Mincha, Traditional)": ["יוֹם כִּפּוּר מִנחָה"], "Yom Kippur (Mincha, Alternate)": ["יוֹם כִּפּוּר מִנחָה"], "Sukkot I (on Shabbat)": ["סוּכּוֹת יוֹם א׳ (בְּשַׁבָּת)"], "Sukkot Chol ha-Moed Day 1": ["סוּכּוֹת חוֹל הַמּוֹעֵד יוֹם א׳"], "Sukkot Chol ha-Moed Day 2": ["סוּכּוֹת חוֹל הַמּוֹעֵד יוֹם ב׳"], "Sukkot Chol ha-Moed Day 3": ["סוּכּוֹת חוֹל הַמּוֹעֵד יוֹם ג׳"], "Sukkot Chol ha-Moed Day 4": ["סוּכּוֹת חוֹל הַמּוֹעֵד יוֹם ד׳"], "Sukkot Chol ha-Moed Day 5": ["סוּכּוֹת חוֹל הַמּוֹעֵד יוֹם ה׳"], "Sukkot Shabbat Chol ha-Moed": ["סוּכּוֹת שַׁבָּת חוֹל הַמּוֹעֵד"], "Sukkot Final Day (Hoshana Raba)": ["סוּכּוֹת ז׳ (הוֹשַׁעְנָא רַבָּה)"], "Shmini Atzeret (on Shabbat)": ["שְׁמִינִי עֲצֶרֶת (בְּשַׁבָּת)"], "Chanukah Day 1": ["חֲנוּכָּה יוֹם א׳"], "Chanukah Day 2": ["חֲנוּכָּה יוֹם ב׳"], "Chanukah Day 3": ["חֲנוּכָּה יוֹם ג׳"], "Chanukah Day 4": ["חֲנוּכָּה יוֹם ד׳"], "Chanukah Day 5": ["חֲנוּכָּה יוֹם ה׳"], "Chanukah Day 6": ["חֲנוּכָּה יוֹם ו׳"], "Chanukah Day 7": ["חֲנוּכָּה יוֹם ז׳"], "Chanukah Day 7 (on Rosh Chodesh)": ["חֲנוּכָּה יוֹם ז׳ (רֹאשׁ חוֹדֶשׁ)"], "Chanukah Day 8": ["חֲנוּכָּה יוֹם ח׳"], "Chanukah Day 1 (on Shabbat)": ["חֲנוּכָּה יוֹם א׳ (בְּשַׁבָּת)"], "Chanukah Day 2 (on Shabbat)": ["חֲנוּכָּה יוֹם ב׳ (בְּשַׁבָּת)"], "Chanukah Day 3 (on Shabbat)": ["חֲנוּכָּה יוֹם ג׳ (בְּשַׁבָּת)"], "Chanukah Day 4 (on Shabbat)": ["חֲנוּכָּה יוֹם ד׳ (בְּשַׁבָּת)"], "Chanukah Day 5 (on Shabbat)": ["חֲנוּכָּה יוֹם ה׳ (בְּשַׁבָּת)"], "Chanukah Day 7 (on Shabbat)": ["חֲנוּכָּה יוֹם ז׳ (בְּשַׁבָּת)"], "Chanukah Day 8 (on Shabbat)": ["חֲנוּכָּה יוֹם ח׳ (בְּשַׁבָּת)"], "Shabbat Rosh Chodesh Chanukah": ["שַׁבָּת רֹאשׁ חוֹדֶשׁ חֲנוּכָּה"], "Yom Kippur (Mincha)": ["יוֹם כִּפּוּר מִנחָה"], "Tish'a B'Av (Mincha)": ["תִּשְׁעָה בְּאָב מִנחָה"], "Asara B'Tevet (Mincha)": ["עֲשָׂרָה בְּטֵבֵת מִנחָה"], "Ta'anit Bechorot (Mincha)": ["תַּעֲנִית בְּכוֹרוֹת מִנחָה"], "Ta'anit Esther (Mincha)": ["תַּעֲנִית אֶסְתֵּר מִנחָה"], "Tzom Gedaliah (Mincha)": ["צוֹם גְּדַלְיָה מִנחָה"], "Tzom Tammuz (Mincha)": ["צוֹם י״ז בְּתַמּוּז מִנחָה"] } } };
6
6
 
7
+ var poAshkenazi$1 = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);", "language": "en_CA@ashkenazi" }, "contexts": { "": { "Shabbat Machar Chodesh": ["Shabbos Machar Chodesh"], "Shabbat Rosh Chodesh": ["Shabbos Rosh Chodesh"], "Pesach I (on Shabbat)": ["Pesach I (on Shabbos)"], "Pesach Shabbat Chol ha-Moed": ["Pesach Shabbos Chol ha-Moed"], "Pesach VII (on Shabbat)": ["Pesach VII (on Shabbos)"], "Pesach VIII (on Shabbat)": ["Pesach VIII (on Shabbos)"], "Shavuot II (on Shabbat)": ["Shavuos II (on Shabbos)"], "Rosh Hashana I (on Shabbat)": ["Rosh Hashana I (on Shabbos)"], "Yom Kippur (on Shabbat)": ["Yom Kippur (on Shabbos)"], "Sukkot I (on Shabbat)": ["Sukkos I (on Shabbos)"], "Sukkot Chol ha-Moed Day 1": ["Sukkos Chol ha-Moed Day 1"], "Sukkot Chol ha-Moed Day 2": ["Sukkos Chol ha-Moed Day 2"], "Sukkot Chol ha-Moed Day 3": ["Sukkos Chol ha-Moed Day 3"], "Sukkot Chol ha-Moed Day 4": ["Sukkos Chol ha-Moed Day 4"], "Sukkot Chol ha-Moed Day 5": ["Sukkos Chol ha-Moed Day 5"], "Sukkot Shabbat Chol ha-Moed": ["Sukkos Shabbos Chol ha-Moed"], "Sukkot Final Day (Hoshana Raba)": ["Sukkos Final Day (Hoshana Raba)"], "Shmini Atzeret (on Shabbat)": ["Shmini Atzeres (on Shabbos)"], "Chanukah Day 1 (on Shabbat)": ["Chanukah Day 1 (on Shabbos)"], "Chanukah Day 2 (on Shabbat)": ["Chanukah Day 2 (on Shabbos)"], "Chanukah Day 3 (on Shabbat)": ["Chanukah Day 3 (on Shabbos)"], "Chanukah Day 4 (on Shabbat)": ["Chanukah Day 4 (on Shabbos)"], "Chanukah Day 5 (on Shabbat)": ["Chanukah Day 5 (on Shabbos)"], "Chanukah Day 7 (on Shabbat)": ["Chanukah Day 7 (on Shabbos)"], "Chanukah Day 8 (on Shabbat)": ["Chanukah Day 8 (on Shabbos)"], "Shabbat Rosh Chodesh Chanukah": ["Shabbos Rosh Chodesh Chanukah"], "Asara B'Tevet (Mincha)": ["Asara B’Teves (Mincha)"], "Ta'anit Bechorot (Mincha)": ["Ta’anis Bechorot (Mincha)"], "Ta'anit Esther (Mincha)": ["Ta’anis Esther (Mincha)"] } } };
8
+
9
+ locale.Locale.addTranslations('ashkenazi', poAshkenazi$1);
7
10
  locale.Locale.addTranslations('he', poHe$1);
8
- locale.Locale.addTranslations('h', poHe$1);
9
- const heStrs$1 = poHe$1.contexts[''];
10
- const heNoNikud$1 = {};
11
- for (const [key, val] of Object.entries(heStrs$1)) {
12
- heNoNikud$1[key] = [locale.Locale.hebrewStripNikkud(val[0])];
13
- }
14
- const poHeNoNikud$1 = {
15
- headers: poHe$1.headers,
16
- contexts: { '': heNoNikud$1 },
17
- };
11
+ const poHeNoNikud$1 = locale.Locale.copyLocaleNoNikud(poHe$1);
18
12
  locale.Locale.addTranslations('he-x-NoNikud', poHeNoNikud$1);
19
13
 
20
14
  const Genesis=[0,31,25,24,26,32,22,24,22,29,32,32,20,18,24,21,16,27,33,38,18,34,24,20,67,34,35,46,22,35,43,54,33,20,31,29,43,36,30,23,23,57,38,34,34,28,34,31,22,33,26];const Exodus=[0,22,25,22,31,23,30,29,28,35,29,10,51,22,31,27,36,16,27,25,23,37,30,33,18,40,37,21,43,46,38,18,35,23,35,35,38,29,31,43,38];const Leviticus=[0,17,16,17,35,26,23,38,36,24,20,47,8,59,57,33,34,16,30,37,27,24,33,44,23,55,46,34];const Numbers=[0,54,34,51,49,31,27,89,26,23,36,35,16,33,45,41,35,28,32,22,29,35,41,30,25,19,65,23,31,39,17,54,42,56,29,34,13];const Deuteronomy=[0,46,37,29,49,30,25,26,20,29,22,32,31,19,29,23,22,20,22,21,20,23,29,26,22,19,19,26,69,28,20,30,52,29,12];const Joshua=[0,18,24,17,24,15,27,26,35,27,43,23,24,33,15,63,10,18,28,51,9,45,34,16,33];const Judges=[0,36,23,31,24,31,40,25,35,57,18,40,15,25,20,20,31,13,31,30,48,25];const Ruth=[0,22,23,18,22];const Isaiah=[0,31,22,26,6,30,13,25,23,20,34,16,6,22,32,9,14,14,7,25,6,17,25,18,23,12,21,13,29,24,33,9,20,24,17,10,22,38,22,8,31,29,25,28,28,25,13,15,22,26,11,23,15,12,17,13,12,21,14,21,22,11,12,19,11,25,24];const Jeremiah=[0,19,37,25,31,31,30,34,23,25,25,23,17,27,22,21,21,27,23,15,18,14,30,40,10,38,24,22,17,32,24,40,44,26,22,19,32,21,28,18,16,18,22,13,30,5,28,7,47,39,46,64,34];const Lamentations=[0,22,22,66,22,22];const Esther=[0,22,23,15,17,14,14,10,17,32,3];const Ecclesiastes=[0,18,26,22,17,19,12,29,17,18,20,10,14];const Ezekiel=[0,28,10,27,17,17,14,27,18,11,22,25,28,23,23,8,63,24,32,14,44,37,31,49,27,17,21,36,26,21,26,18,32,33,31,15,38,28,23,29,49,26,20,27,31,25,24,23,35];const Daniel=[0,21,49,100,34,30,29,28,27,27,21,45,13,64,42];const Hosea=[0,9,25,5,19,15,11,16,14,17,15,11,15,15,10];const Joel=[0,20,27,5,21];const Amos=[0,15,16,15,13,27,14,17,14,15];const Obadiah=[0,21];const Jonah=[0,16,11,10,11];const Micah=[0,16,13,12,14,14,16,20];const Nachum=[0,14,14,19];const Habakkuk=[0,17,20,19];const Zephaniah=[0,18,15,20];const Haggai=[0,15,23];const Zechariah=[0,17,17,10,14,11,15,14,23,17,12,17,14,9,21];const Malachi=[0,14,17,24];var numverses = {Genesis:Genesis,Exodus:Exodus,Leviticus:Leviticus,Numbers:Numbers,Deuteronomy:Deuteronomy,Joshua:Joshua,Judges:Judges,Ruth:Ruth,"I Samuel":[0,28,36,21,22,12,21,17,22,27,27,15,25,23,52,35,23,58,30,24,42,16,23,28,23,43,25,12,25,11,31,13],"II Samuel":[0,27,32,39,12,25,23,29,18,13,19,27,31,39,33,37,23,29,32,44,26,22,51,39,25],"I Kings":[0,53,46,28,20,32,38,51,66,28,29,43,33,34,31,34,34,24,46,21,43,29,54],"II Kings":[0,18,25,27,44,27,33,20,29,37,36,20,22,25,29,38,20,41,37,37,21,26,20,37,20,30],Isaiah:Isaiah,Jeremiah:Jeremiah,Lamentations:Lamentations,Esther:Esther,Ecclesiastes:Ecclesiastes,"Song of Songs":[0,17,17,11,16,16,12,14,14],Ezekiel:Ezekiel,Daniel:Daniel,Hosea:Hosea,Joel:Joel,Amos:Amos,Obadiah:Obadiah,Jonah:Jonah,Micah:Micah,Nachum:Nachum,Habakkuk:Habakkuk,Zephaniah:Zephaniah,Haggai:Haggai,Zechariah:Zechariah,Malachi:Malachi};
@@ -305,7 +299,7 @@ function lookupFestival(holiday) {
305
299
  return result;
306
300
  }
307
301
 
308
- /*! @hebcal/hdate v0.14.4, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
302
+ /*! @hebcal/hdate v0.21.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
309
303
  /* eslint-disable @typescript-eslint/no-namespace, no-inner-declarations */
310
304
  /** @private */
311
305
  const lengths = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
@@ -446,7 +440,7 @@ function abs2greg(abs) {
446
440
  return dt;
447
441
  }
448
442
 
449
- /*! @hebcal/hdate v0.14.4, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
443
+ /*! @hebcal/hdate v0.21.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
450
444
 
451
445
  /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-namespace */
452
446
  /**
@@ -461,9 +455,9 @@ greg.greg2abs = greg2abs;
461
455
  greg.isDate = isDate;
462
456
  greg.isLeapYear = isGregLeapYear;
463
457
 
464
- /*! @hebcal/hdate v0.14.4, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
458
+ /*! @hebcal/hdate v0.21.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
465
459
  /**
466
- * Removes nekudot from Hebrew string
460
+ * Removes niqqud from Hebrew string
467
461
  */
468
462
  function hebrewStripNikkud(str) {
469
463
  const a = str.normalize();
@@ -471,7 +465,7 @@ function hebrewStripNikkud(str) {
471
465
  return a.replace(/[\u0590-\u05bd]/g, '').replace(/[\u05bf-\u05c7]/g, '');
472
466
  }
473
467
 
474
- /*! @hebcal/hdate v0.14.4, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
468
+ /*! @hebcal/hdate v0.21.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
475
469
 
476
470
  /*
477
471
  * More minimal HDate
@@ -840,7 +834,7 @@ function monthFromName(monthName) {
840
834
  throw new RangeError(`bad monthName: ${monthName}`);
841
835
  }
842
836
 
843
- /*! @hebcal/hdate v0.14.4, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
837
+ /*! @hebcal/hdate v0.21.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
844
838
  const GERESH = '׳';
845
839
  const GERSHAYIM = '״';
846
840
  const heb2num = {
@@ -953,13 +947,13 @@ function gematriyaStrToNum(str) {
953
947
  return num;
954
948
  }
955
949
 
956
- /*! @hebcal/hdate v0.14.4, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
950
+ /*! @hebcal/hdate v0.21.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
957
951
  var poAshkenazi = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);", "language": "en_CA@ashkenazi" }, "contexts": { "": { "Tevet": ["Teves"] } } };
958
952
 
959
- /*! @hebcal/hdate v0.14.4, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
953
+ /*! @hebcal/hdate v0.21.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
960
954
  var poHe = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);", "language": "he" }, "contexts": { "": { "Adar": ["אֲדָר"], "Adar I": ["אֲדָר א׳"], "Adar II": ["אֲדָר ב׳"], "Av": ["אָב"], "Cheshvan": ["חֶשְׁוָן"], "Elul": ["אֱלוּל"], "Iyyar": ["אִיָּיר"], "Kislev": ["כִּסְלֵו"], "Nisan": ["נִיסָן"], "Sh'vat": ["שְׁבָט"], "Sivan": ["סִיוָן"], "Tamuz": ["תַּמּוּז"], "Tevet": ["טֵבֵת"], "Tishrei": ["תִּשְׁרֵי"] } } };
961
955
 
962
- /*! @hebcal/hdate v0.14.4, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
956
+ /*! @hebcal/hdate v0.21.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
963
957
 
964
958
  const noopLocale = {
965
959
  headers: { 'plural-forms': 'nplurals=2; plural=(n!=1);' },
@@ -974,10 +968,6 @@ const alias = {
974
968
  /** @private */
975
969
  const locales = new Map();
976
970
  /** @private */
977
- let activeLocale;
978
- /** @private */
979
- let activeName;
980
- /** @private */
981
971
  function getEnOrdinal(n) {
982
972
  const s = ['th', 'st', 'nd', 'rd'];
983
973
  const v = n % 100;
@@ -988,6 +978,7 @@ function checkLocale(locale) {
988
978
  if (typeof locale !== 'string') {
989
979
  throw new TypeError(`Invalid locale name: ${locale}`);
990
980
  }
981
+ locale = alias[locale] || locale;
991
982
  return locale.toLowerCase();
992
983
  }
993
984
  /** @private */
@@ -1012,11 +1003,11 @@ class Locale {
1012
1003
  * Returns translation only if `locale` offers a non-empty translation for `id`.
1013
1004
  * Otherwise, returns `undefined`.
1014
1005
  * @param id Message ID to translate
1015
- * @param [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale.
1006
+ * @param [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to no-op locale.
1016
1007
  */
1017
1008
  static lookupTranslation(id, locale) {
1018
- const loc = (typeof locale === 'string' && locales.get(locale.toLowerCase())) ||
1019
- activeLocale;
1009
+ const loc = (typeof locale === 'string' && locales.get(checkLocale(locale))) ||
1010
+ noopLocale.contexts[''];
1020
1011
  const array = loc[id];
1021
1012
  if ((array === null || array === void 0 ? void 0 : array.length) && array[0].length) {
1022
1013
  return array[0];
@@ -1026,7 +1017,7 @@ class Locale {
1026
1017
  /**
1027
1018
  * By default, if no translation was found, returns `id`.
1028
1019
  * @param id Message ID to translate
1029
- * @param [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale.
1020
+ * @param [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to no-op locale.
1030
1021
  */
1031
1022
  static gettext(id, locale) {
1032
1023
  const text = this.lookupTranslation(id, locale);
@@ -1042,11 +1033,11 @@ class Locale {
1042
1033
  */
1043
1034
  static addLocale(locale, data) {
1044
1035
  locale = checkLocale(locale);
1045
- if (typeof data.contexts !== 'object' ||
1046
- typeof data.contexts[''] !== 'object') {
1036
+ const ctx = data.contexts;
1037
+ if (typeof ctx !== 'object' || typeof ctx[''] !== 'object') {
1047
1038
  throw new TypeError(`Locale '${locale}' invalid compact format`);
1048
1039
  }
1049
- locales.set(locale, data.contexts['']);
1040
+ locales.set(locale, ctx['']);
1050
1041
  }
1051
1042
  /**
1052
1043
  * Adds a translation to `locale`, replacing any previous translation.
@@ -1078,33 +1069,11 @@ class Locale {
1078
1069
  */
1079
1070
  static addTranslations(locale, data) {
1080
1071
  const loc = getExistingLocale(locale);
1081
- if (typeof data.contexts !== 'object' ||
1082
- typeof data.contexts[''] !== 'object') {
1072
+ const ctx = data.contexts;
1073
+ if (typeof ctx !== 'object' || typeof ctx[''] !== 'object') {
1083
1074
  throw new TypeError(`Locale '${locale}' invalid compact format`);
1084
1075
  }
1085
- const ctx = data.contexts[''];
1086
- Object.assign(loc, ctx);
1087
- }
1088
- /**
1089
- * Activates a locale. Throws an error if the locale has not been previously added.
1090
- * After setting the locale to be used, all strings marked for translations
1091
- * will be represented by the corresponding translation in the specified locale.
1092
- * @param locale Locale name (i.e: `'he'`, `'fr'`)
1093
- * @deprecated
1094
- */
1095
- static useLocale(locale) {
1096
- const locale0 = checkLocale(locale);
1097
- const obj = getExistingLocale(locale0);
1098
- activeName = alias[locale0] || locale0;
1099
- activeLocale = obj;
1100
- return activeLocale;
1101
- }
1102
- /**
1103
- * Returns the name of the active locale (i.e. 'he', 'ashkenazi', 'fr')
1104
- * @deprecated
1105
- */
1106
- static getLocaleName() {
1107
- return activeName;
1076
+ Object.assign(loc, ctx['']);
1108
1077
  }
1109
1078
  /**
1110
1079
  * Returns the names of registered locales
@@ -1113,24 +1082,30 @@ class Locale {
1113
1082
  const keys = Array.from(locales.keys());
1114
1083
  return keys.sort((a, b) => a.localeCompare(b));
1115
1084
  }
1085
+ /**
1086
+ * Checks whether a locale has been registered
1087
+ * @param locale Locale name (i.e: `'he'`, `'fr'`).
1088
+ */
1089
+ static hasLocale(locale) {
1090
+ const locale1 = checkLocale(locale);
1091
+ return locales.has(locale1);
1092
+ }
1116
1093
  /**
1117
1094
  * Renders a number in ordinal, such as 1st, 2nd or 3rd
1118
- * @param [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale.
1095
+ * @param [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to no-op locale.
1119
1096
  */
1120
1097
  static ordinal(n, locale) {
1121
- const locale1 = locale === null || locale === void 0 ? void 0 : locale.toLowerCase();
1122
- const locale0 = locale1 || activeName;
1098
+ let locale0 = locale === null || locale === void 0 ? void 0 : locale.toLowerCase();
1123
1099
  if (!locale0) {
1124
1100
  return getEnOrdinal(n);
1125
1101
  }
1102
+ locale0 = alias[locale0] || locale0;
1126
1103
  switch (locale0) {
1127
1104
  case 'en':
1128
- case 's':
1129
- case 'a':
1105
+ case 'ashkenazi':
1130
1106
  return getEnOrdinal(n);
1131
1107
  case 'es':
1132
1108
  return n + 'º';
1133
- case 'h':
1134
1109
  case 'he':
1135
1110
  case 'he-x-nonikud':
1136
1111
  return String(n);
@@ -1146,30 +1121,31 @@ class Locale {
1146
1121
  static hebrewStripNikkud(str) {
1147
1122
  return hebrewStripNikkud(str);
1148
1123
  }
1124
+ /**
1125
+ * Makes a copy of entire Hebrew locale with no niqqud
1126
+ */
1127
+ static copyLocaleNoNikud(data) {
1128
+ const strs = data.contexts[''];
1129
+ const m = {};
1130
+ for (const [key, val] of Object.entries(strs)) {
1131
+ m[key] = [hebrewStripNikkud(val[0])];
1132
+ }
1133
+ return {
1134
+ headers: data.headers,
1135
+ contexts: { '': m },
1136
+ };
1137
+ }
1149
1138
  }
1150
1139
  Locale.addLocale('en', noopLocale);
1151
- Locale.addLocale('s', noopLocale);
1152
- Locale.addLocale('', noopLocale);
1153
- Locale.useLocale('en');
1154
1140
  /* Ashkenazic transliterations */
1155
1141
  Locale.addLocale('ashkenazi', poAshkenazi);
1156
- Locale.addLocale('a', poAshkenazi);
1157
1142
  /* Hebrew with nikkud */
1158
1143
  Locale.addLocale('he', poHe);
1159
- Locale.addLocale('h', poHe);
1160
1144
  /* Hebrew without nikkud */
1161
- const heStrs = poHe.contexts[''];
1162
- const heNoNikud = {};
1163
- for (const [key, val] of Object.entries(heStrs)) {
1164
- heNoNikud[key] = [Locale.hebrewStripNikkud(val[0])];
1165
- }
1166
- const poHeNoNikud = {
1167
- headers: poHe.headers,
1168
- contexts: { '': heNoNikud },
1169
- };
1145
+ const poHeNoNikud = Locale.copyLocaleNoNikud(poHe);
1170
1146
  Locale.addLocale('he-x-NoNikud', poHeNoNikud);
1171
1147
 
1172
- /*! @hebcal/hdate v0.14.4, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1148
+ /*! @hebcal/hdate v0.21.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1173
1149
 
1174
1150
  /*
1175
1151
  Hebcal - A Jewish Calendar Generator
@@ -1442,7 +1418,7 @@ class HDate {
1442
1418
  * @see {@link Locale}
1443
1419
  */
1444
1420
  render(locale, showYear = true) {
1445
- const locale0 = locale || Locale.getLocaleName();
1421
+ const locale0 = locale || 'en';
1446
1422
  const day = this.getDate();
1447
1423
  const monthName0 = Locale.gettext(this.getMonthName(), locale0);
1448
1424
  const monthName = monthName0.replace(/'/g, '’');
@@ -2418,7 +2394,7 @@ function getLeyningForParshaHaShavua(ev, il = false) {
2418
2394
  throw new TypeError(`Event must be parsha hashavua: ${ev.getDesc()}`);
2419
2395
  }
2420
2396
  // first, collect the default aliyot and haftara
2421
- const parsha = ev.parsha;
2397
+ const parsha = ev.p.parsha;
2422
2398
  const result = getLeyningForParshaShabbatOnly(parsha);
2423
2399
  const hd = ev.getDate();
2424
2400
  // Now, check for special maftir or haftara on same date
@@ -2512,6 +2488,7 @@ function findParshaHaShavua(saturday, il) {
2512
2488
  chag: false,
2513
2489
  num: 54,
2514
2490
  hdate: saturday,
2491
+ il,
2515
2492
  };
2516
2493
  }
2517
2494
  }
@@ -2537,7 +2514,7 @@ function getLeyningOnDate(hdate, il, wantarray = false) {
2537
2514
  const sedra$1 = sedra.getSedra(hyear, il);
2538
2515
  const parsha = sedra$1.lookup(hdate);
2539
2516
  if (!parsha.chag) {
2540
- const parshaEvent = new ParshaEvent.ParshaEvent(hdate, parsha.parsha, il);
2517
+ const parshaEvent = new ParshaEvent.ParshaEvent(parsha);
2541
2518
  const reading = getLeyningForParshaHaShavua(parshaEvent, il);
2542
2519
  if (wantarray) {
2543
2520
  hasParshaHaShavua = true;