@hebcal/core 5.0.0-rc6 → 5.0.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 +9 -19
- package/dist/bundle.min.js +2 -2
- package/dist/index.js +7 -16
- package/dist/index.mjs +7 -16
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v5.0.0
|
|
1
|
+
/*! @hebcal/core v5.0.0 */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
const GERESH = '׳';
|
|
@@ -1156,7 +1156,7 @@ class HDate {
|
|
|
1156
1156
|
* @private
|
|
1157
1157
|
* @type {number}
|
|
1158
1158
|
*/
|
|
1159
|
-
this.
|
|
1159
|
+
this.rd = abs0;
|
|
1160
1160
|
}
|
|
1161
1161
|
}
|
|
1162
1162
|
}
|
|
@@ -1257,10 +1257,10 @@ class HDate {
|
|
|
1257
1257
|
* @return {number}
|
|
1258
1258
|
*/
|
|
1259
1259
|
abs() {
|
|
1260
|
-
if (typeof this.
|
|
1261
|
-
this.
|
|
1260
|
+
if (typeof this.rd !== 'number') {
|
|
1261
|
+
this.rd = hebrew2abs(this.yy, this.mm, this.dd);
|
|
1262
1262
|
}
|
|
1263
|
-
return this.
|
|
1263
|
+
return this.rd;
|
|
1264
1264
|
}
|
|
1265
1265
|
|
|
1266
1266
|
/**
|
|
@@ -1746,7 +1746,7 @@ function fixMonth(date) {
|
|
|
1746
1746
|
date.yy += 1;
|
|
1747
1747
|
fix(date);
|
|
1748
1748
|
}
|
|
1749
|
-
delete date.
|
|
1749
|
+
delete date.rd;
|
|
1750
1750
|
}
|
|
1751
1751
|
|
|
1752
1752
|
/**
|
|
@@ -3940,7 +3940,6 @@ function makeCandleEvent(e, hd, dow, location, options) {
|
|
|
3940
3940
|
if (isNaN(time.getTime())) {
|
|
3941
3941
|
return null; // no sunset
|
|
3942
3942
|
}
|
|
3943
|
-
|
|
3944
3943
|
if (havdalahTitle) {
|
|
3945
3944
|
return new HavdalahEvent(hd, mask, time, location, options.havdalahMins, e);
|
|
3946
3945
|
} else {
|
|
@@ -4575,7 +4574,6 @@ class Sedra {
|
|
|
4575
4574
|
if (idx === -1) {
|
|
4576
4575
|
return null; // doesn't occur this year
|
|
4577
4576
|
}
|
|
4578
|
-
|
|
4579
4577
|
return new HDate(this.firstSaturday + idx * 7);
|
|
4580
4578
|
} else if (typeof parsha === 'string') {
|
|
4581
4579
|
const num = parsha2id.get(parsha);
|
|
@@ -4589,7 +4587,6 @@ class Sedra {
|
|
|
4589
4587
|
if (idx === -1) {
|
|
4590
4588
|
return null; // doesn't occur this year
|
|
4591
4589
|
}
|
|
4592
|
-
|
|
4593
4590
|
return new HDate(this.firstSaturday + idx * 7);
|
|
4594
4591
|
}
|
|
4595
4592
|
} else if (Array.isArray(parsha) && parsha.length === 1 && typeof parsha[0] === 'string') {
|
|
@@ -4646,7 +4643,6 @@ class Sedra {
|
|
|
4646
4643
|
const sedra = new Sedra(this.year + 1, this.il);
|
|
4647
4644
|
return sedra.lookup(saturday); // must be next year
|
|
4648
4645
|
}
|
|
4649
|
-
|
|
4650
4646
|
if (typeof index === 'string') {
|
|
4651
4647
|
// Shabbat has a chag. Return a description
|
|
4652
4648
|
return {
|
|
@@ -5926,7 +5922,7 @@ class DailyLearning {
|
|
|
5926
5922
|
}
|
|
5927
5923
|
}
|
|
5928
5924
|
|
|
5929
|
-
const version="5.0.0
|
|
5925
|
+
const version="5.0.0";
|
|
5930
5926
|
|
|
5931
5927
|
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};
|
|
5932
5928
|
|
|
@@ -6106,7 +6102,6 @@ function tachanunYear(year, il) {
|
|
|
6106
6102
|
// Purim
|
|
6107
6103
|
shushPurim, leap ? new HDate(14, months.ADAR_I, year) : [] // Purim Katan
|
|
6108
6104
|
);
|
|
6109
|
-
|
|
6110
6105
|
const some = [].concat(
|
|
6111
6106
|
// Until 14 Sivan
|
|
6112
6107
|
range(1, 13).map(mday => new HDate(mday, months.SIVAN, year)),
|
|
@@ -6123,7 +6118,6 @@ function tachanunYear(year, il) {
|
|
|
6123
6118
|
// Erev Yom Kippur
|
|
6124
6119
|
new HDate(14, months.IYYAR, year) // Pesach Sheini
|
|
6125
6120
|
);
|
|
6126
|
-
|
|
6127
6121
|
return {
|
|
6128
6122
|
none: none.map(hd => hd.abs()).sort((a, b) => a - b),
|
|
6129
6123
|
some: some.map(hd => hd.abs()).sort((a, b) => a - b),
|
|
@@ -7082,12 +7076,10 @@ function appendHolidayAndRelated(events, ev, options, candlesEv, dow) {
|
|
|
7082
7076
|
if (!ev.observedIn(il)) {
|
|
7083
7077
|
return candlesEv; // holiday isn't observed here; bail out early
|
|
7084
7078
|
}
|
|
7085
|
-
|
|
7086
7079
|
const eFlags = ev.getFlags();
|
|
7087
7080
|
if (!options.yomKippurKatan && eFlags & YOM_KIPPUR_KATAN || options.noModern && eFlags & MODERN_HOLIDAY) {
|
|
7088
7081
|
return candlesEv; // bail out early
|
|
7089
7082
|
}
|
|
7090
|
-
|
|
7091
7083
|
const location = options.location;
|
|
7092
7084
|
const isMajorFast = Boolean(eFlags & MAJOR_FAST);
|
|
7093
7085
|
const isMinorFast = Boolean(eFlags & MINOR_FAST);
|
|
@@ -7120,7 +7112,6 @@ function appendHolidayAndRelated(events, ev, options, candlesEv, dow) {
|
|
|
7120
7112
|
events.push(ev); // the original event itself
|
|
7121
7113
|
}
|
|
7122
7114
|
}
|
|
7123
|
-
|
|
7124
7115
|
if (ev.endEvent && (isMajorFast || isMinorFast && !options.noMinorFast)) {
|
|
7125
7116
|
events.push(ev.endEvent);
|
|
7126
7117
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v5.0.0
|
|
1
|
+
/*! @hebcal/core v5.0.0 */
|
|
2
2
|
const GERESH = '׳';
|
|
3
3
|
const GERSHAYIM = '״';
|
|
4
4
|
const heb2num = {
|
|
@@ -1154,7 +1154,7 @@ class HDate {
|
|
|
1154
1154
|
* @private
|
|
1155
1155
|
* @type {number}
|
|
1156
1156
|
*/
|
|
1157
|
-
this.
|
|
1157
|
+
this.rd = abs0;
|
|
1158
1158
|
}
|
|
1159
1159
|
}
|
|
1160
1160
|
}
|
|
@@ -1255,10 +1255,10 @@ class HDate {
|
|
|
1255
1255
|
* @return {number}
|
|
1256
1256
|
*/
|
|
1257
1257
|
abs() {
|
|
1258
|
-
if (typeof this.
|
|
1259
|
-
this.
|
|
1258
|
+
if (typeof this.rd !== 'number') {
|
|
1259
|
+
this.rd = hebrew2abs(this.yy, this.mm, this.dd);
|
|
1260
1260
|
}
|
|
1261
|
-
return this.
|
|
1261
|
+
return this.rd;
|
|
1262
1262
|
}
|
|
1263
1263
|
|
|
1264
1264
|
/**
|
|
@@ -1744,7 +1744,7 @@ function fixMonth(date) {
|
|
|
1744
1744
|
date.yy += 1;
|
|
1745
1745
|
fix(date);
|
|
1746
1746
|
}
|
|
1747
|
-
delete date.
|
|
1747
|
+
delete date.rd;
|
|
1748
1748
|
}
|
|
1749
1749
|
|
|
1750
1750
|
/**
|
|
@@ -3938,7 +3938,6 @@ function makeCandleEvent(e, hd, dow, location, options) {
|
|
|
3938
3938
|
if (isNaN(time.getTime())) {
|
|
3939
3939
|
return null; // no sunset
|
|
3940
3940
|
}
|
|
3941
|
-
|
|
3942
3941
|
if (havdalahTitle) {
|
|
3943
3942
|
return new HavdalahEvent(hd, mask, time, location, options.havdalahMins, e);
|
|
3944
3943
|
} else {
|
|
@@ -4573,7 +4572,6 @@ class Sedra {
|
|
|
4573
4572
|
if (idx === -1) {
|
|
4574
4573
|
return null; // doesn't occur this year
|
|
4575
4574
|
}
|
|
4576
|
-
|
|
4577
4575
|
return new HDate(this.firstSaturday + idx * 7);
|
|
4578
4576
|
} else if (typeof parsha === 'string') {
|
|
4579
4577
|
const num = parsha2id.get(parsha);
|
|
@@ -4587,7 +4585,6 @@ class Sedra {
|
|
|
4587
4585
|
if (idx === -1) {
|
|
4588
4586
|
return null; // doesn't occur this year
|
|
4589
4587
|
}
|
|
4590
|
-
|
|
4591
4588
|
return new HDate(this.firstSaturday + idx * 7);
|
|
4592
4589
|
}
|
|
4593
4590
|
} else if (Array.isArray(parsha) && parsha.length === 1 && typeof parsha[0] === 'string') {
|
|
@@ -4644,7 +4641,6 @@ class Sedra {
|
|
|
4644
4641
|
const sedra = new Sedra(this.year + 1, this.il);
|
|
4645
4642
|
return sedra.lookup(saturday); // must be next year
|
|
4646
4643
|
}
|
|
4647
|
-
|
|
4648
4644
|
if (typeof index === 'string') {
|
|
4649
4645
|
// Shabbat has a chag. Return a description
|
|
4650
4646
|
return {
|
|
@@ -5924,7 +5920,7 @@ class DailyLearning {
|
|
|
5924
5920
|
}
|
|
5925
5921
|
}
|
|
5926
5922
|
|
|
5927
|
-
const version="5.0.0
|
|
5923
|
+
const version="5.0.0";
|
|
5928
5924
|
|
|
5929
5925
|
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};
|
|
5930
5926
|
|
|
@@ -6104,7 +6100,6 @@ function tachanunYear(year, il) {
|
|
|
6104
6100
|
// Purim
|
|
6105
6101
|
shushPurim, leap ? new HDate(14, months.ADAR_I, year) : [] // Purim Katan
|
|
6106
6102
|
);
|
|
6107
|
-
|
|
6108
6103
|
const some = [].concat(
|
|
6109
6104
|
// Until 14 Sivan
|
|
6110
6105
|
range(1, 13).map(mday => new HDate(mday, months.SIVAN, year)),
|
|
@@ -6121,7 +6116,6 @@ function tachanunYear(year, il) {
|
|
|
6121
6116
|
// Erev Yom Kippur
|
|
6122
6117
|
new HDate(14, months.IYYAR, year) // Pesach Sheini
|
|
6123
6118
|
);
|
|
6124
|
-
|
|
6125
6119
|
return {
|
|
6126
6120
|
none: none.map(hd => hd.abs()).sort((a, b) => a - b),
|
|
6127
6121
|
some: some.map(hd => hd.abs()).sort((a, b) => a - b),
|
|
@@ -7080,12 +7074,10 @@ function appendHolidayAndRelated(events, ev, options, candlesEv, dow) {
|
|
|
7080
7074
|
if (!ev.observedIn(il)) {
|
|
7081
7075
|
return candlesEv; // holiday isn't observed here; bail out early
|
|
7082
7076
|
}
|
|
7083
|
-
|
|
7084
7077
|
const eFlags = ev.getFlags();
|
|
7085
7078
|
if (!options.yomKippurKatan && eFlags & YOM_KIPPUR_KATAN || options.noModern && eFlags & MODERN_HOLIDAY) {
|
|
7086
7079
|
return candlesEv; // bail out early
|
|
7087
7080
|
}
|
|
7088
|
-
|
|
7089
7081
|
const location = options.location;
|
|
7090
7082
|
const isMajorFast = Boolean(eFlags & MAJOR_FAST);
|
|
7091
7083
|
const isMinorFast = Boolean(eFlags & MINOR_FAST);
|
|
@@ -7118,7 +7110,6 @@ function appendHolidayAndRelated(events, ev, options, candlesEv, dow) {
|
|
|
7118
7110
|
events.push(ev); // the original event itself
|
|
7119
7111
|
}
|
|
7120
7112
|
}
|
|
7121
|
-
|
|
7122
7113
|
if (ev.endEvent && (isMajorFast || isMinorFast && !options.noMinorFast)) {
|
|
7123
7114
|
events.push(ev.endEvent);
|
|
7124
7115
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hebcal/core",
|
|
3
|
-
"version": "5.0.0
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"author": "Michael J. Radwin (https://github.com/mjradwin)",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Eyal Schachter (https://github.com/Scimonster)",
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"temporal-polyfill": "^0.1.1"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@babel/core": "^7.23.
|
|
67
|
-
"@babel/preset-env": "^7.23.
|
|
66
|
+
"@babel/core": "^7.23.5",
|
|
67
|
+
"@babel/preset-env": "^7.23.5",
|
|
68
68
|
"@babel/register": "^7.22.15",
|
|
69
69
|
"@hebcal/hdate": "^0.8.2",
|
|
70
70
|
"@hebcal/noaa": "^0.8.10",
|
|
@@ -73,14 +73,14 @@
|
|
|
73
73
|
"@rollup/plugin-json": "^6.0.1",
|
|
74
74
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
75
75
|
"@rollup/plugin-terser": "^0.4.4",
|
|
76
|
-
"ava": "^
|
|
77
|
-
"core-js": "^3.
|
|
78
|
-
"eslint": "^8.
|
|
76
|
+
"ava": "^6.0.1",
|
|
77
|
+
"core-js": "^3.34.0",
|
|
78
|
+
"eslint": "^8.55.0",
|
|
79
79
|
"eslint-config-google": "^0.14.0",
|
|
80
80
|
"jsdoc": "^4.0.2",
|
|
81
81
|
"jsdoc-to-markdown": "^8.0.0",
|
|
82
82
|
"nyc": "^15.1.0",
|
|
83
|
-
"rollup": "^4.6.
|
|
83
|
+
"rollup": "^4.6.1",
|
|
84
84
|
"ttag-cli": "^1.10.9"
|
|
85
85
|
}
|
|
86
86
|
}
|