@hebcal/core 5.4.3 → 5.4.5
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 +261 -301
- package/dist/bundle.js +214 -150
- package/dist/bundle.min.js +2 -2
- package/dist/index.cjs +218 -157
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +218 -157
- package/dist/pkgVersion.d.ts +1 -1
- package/dist/sedra.d.ts +2 -0
- package/dist/tachanun.d.ts +3 -0
- package/dist/zmanim.d.ts +44 -6
- package/package.json +8 -8
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v5.4.
|
|
1
|
+
/*! @hebcal/core v5.4.5 */
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-namespace, no-inner-declarations */
|
|
3
3
|
/** @private */
|
|
4
4
|
const lengths = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
@@ -8021,6 +8021,12 @@ class Zmanim {
|
|
|
8021
8021
|
}
|
|
8022
8022
|
/**
|
|
8023
8023
|
* Latest Shacharit (Gra); Sunrise plus 4 halachic hours, according to the Gra.
|
|
8024
|
+
*
|
|
8025
|
+
* This method returns the latest *zman tfila* (time to recite shema in the morning)
|
|
8026
|
+
* that is 4 *shaos zmaniyos* (solar hours) after sunrise or sea level sunrise
|
|
8027
|
+
* (depending on the `useElevation` setting), according
|
|
8028
|
+
* to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).
|
|
8029
|
+
*
|
|
8024
8030
|
* If elevation is enabled, this function will include elevation in the calculation.
|
|
8025
8031
|
* @return {Date}
|
|
8026
8032
|
*/
|
|
@@ -8030,19 +8036,16 @@ class Zmanim {
|
|
|
8030
8036
|
/**
|
|
8031
8037
|
* Returns an array with alot (Date) and ms in hour (number)
|
|
8032
8038
|
* @private
|
|
8033
|
-
* @return {any[]}
|
|
8034
8039
|
*/
|
|
8035
|
-
getTemporalHour72() {
|
|
8036
|
-
const alot72 = this.sunriseOffset(-72, false,
|
|
8037
|
-
const tzeit72 = this.sunsetOffset(72, false,
|
|
8040
|
+
getTemporalHour72(forceSeaLevel) {
|
|
8041
|
+
const alot72 = this.sunriseOffset(-72, false, forceSeaLevel);
|
|
8042
|
+
const tzeit72 = this.sunsetOffset(72, false, forceSeaLevel);
|
|
8038
8043
|
const temporalHour = (tzeit72.getTime() - alot72.getTime()) / 12;
|
|
8039
8044
|
return [alot72, temporalHour];
|
|
8040
8045
|
}
|
|
8041
8046
|
/**
|
|
8042
8047
|
* Returns an array with alot (Date) and ms in hour (number)
|
|
8043
8048
|
* @private
|
|
8044
|
-
* @param {number} angle
|
|
8045
|
-
* @return {any[]}
|
|
8046
8049
|
*/
|
|
8047
8050
|
getTemporalHourByDeg(angle) {
|
|
8048
8051
|
const alot = this.timeAtAngle(angle, true);
|
|
@@ -8058,8 +8061,9 @@ class Zmanim {
|
|
|
8058
8061
|
* @return {Date}
|
|
8059
8062
|
*/
|
|
8060
8063
|
sofZmanShmaMGA() {
|
|
8061
|
-
const [alot72, temporalHour] = this.getTemporalHour72();
|
|
8062
|
-
|
|
8064
|
+
const [alot72, temporalHour] = this.getTemporalHour72(true);
|
|
8065
|
+
const offset = Math.floor(3 * temporalHour);
|
|
8066
|
+
return new Date(alot72.getTime() + offset);
|
|
8063
8067
|
}
|
|
8064
8068
|
/**
|
|
8065
8069
|
* Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.
|
|
@@ -8069,7 +8073,8 @@ class Zmanim {
|
|
|
8069
8073
|
*/
|
|
8070
8074
|
sofZmanShmaMGA16Point1() {
|
|
8071
8075
|
const [alot, temporalHour] = this.getTemporalHourByDeg(16.1);
|
|
8072
|
-
|
|
8076
|
+
const offset = Math.floor(3 * temporalHour);
|
|
8077
|
+
return new Date(alot.getTime() + offset);
|
|
8073
8078
|
}
|
|
8074
8079
|
/**
|
|
8075
8080
|
* Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.
|
|
@@ -8083,15 +8088,17 @@ class Zmanim {
|
|
|
8083
8088
|
*/
|
|
8084
8089
|
sofZmanShmaMGA19Point8() {
|
|
8085
8090
|
const [alot, temporalHour] = this.getTemporalHourByDeg(19.8);
|
|
8086
|
-
|
|
8091
|
+
const offset = Math.floor(3 * temporalHour);
|
|
8092
|
+
return new Date(alot.getTime() + offset);
|
|
8087
8093
|
}
|
|
8088
8094
|
/**
|
|
8089
8095
|
* Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham
|
|
8090
8096
|
* @return {Date}
|
|
8091
8097
|
*/
|
|
8092
8098
|
sofZmanTfillaMGA() {
|
|
8093
|
-
const [alot72, temporalHour] = this.getTemporalHour72();
|
|
8094
|
-
|
|
8099
|
+
const [alot72, temporalHour] = this.getTemporalHour72(true);
|
|
8100
|
+
const offset = Math.floor(4 * temporalHour);
|
|
8101
|
+
return new Date(alot72.getTime() + offset);
|
|
8095
8102
|
}
|
|
8096
8103
|
/**
|
|
8097
8104
|
* Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham.
|
|
@@ -8101,7 +8108,8 @@ class Zmanim {
|
|
|
8101
8108
|
*/
|
|
8102
8109
|
sofZmanTfillaMGA16Point1() {
|
|
8103
8110
|
const [alot, temporalHour] = this.getTemporalHourByDeg(16.1);
|
|
8104
|
-
|
|
8111
|
+
const offset = Math.floor(4 * temporalHour);
|
|
8112
|
+
return new Date(alot.getTime() + offset);
|
|
8105
8113
|
}
|
|
8106
8114
|
/**
|
|
8107
8115
|
* Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham.
|
|
@@ -8115,24 +8123,67 @@ class Zmanim {
|
|
|
8115
8123
|
*/
|
|
8116
8124
|
sofZmanTfillaMGA19Point8() {
|
|
8117
8125
|
const [alot, temporalHour] = this.getTemporalHourByDeg(19.8);
|
|
8118
|
-
|
|
8126
|
+
const offset = Math.floor(4 * temporalHour);
|
|
8127
|
+
return new Date(alot.getTime() + offset);
|
|
8119
8128
|
}
|
|
8120
8129
|
/**
|
|
8121
|
-
* Earliest Mincha – Mincha Gedola; Sunrise plus 6.5 halachic hours.
|
|
8130
|
+
* Earliest Mincha – Mincha Gedola (GRA); Sunrise plus 6.5 halachic hours.
|
|
8122
8131
|
* If elevation is enabled, this function will include elevation in the calculation.
|
|
8132
|
+
*
|
|
8133
|
+
* This method returns the latest mincha gedola, the earliest time one can pray mincha
|
|
8134
|
+
* that is 6.5 shaos zmaniyos (solar hours) after sunrise or sea level sunrise
|
|
8135
|
+
* (depending on the `useElevation` setting), according
|
|
8136
|
+
* to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).
|
|
8137
|
+
*
|
|
8138
|
+
* The Ramba"m is of the opinion that it is better to delay *mincha* until
|
|
8139
|
+
* *mincha ketana* while the Ra"sh, Tur, GRA and others are of the
|
|
8140
|
+
* opinion that *mincha* can be prayed *lechatchila* starting at *mincha gedola*.
|
|
8123
8141
|
* @return {Date}
|
|
8124
8142
|
*/
|
|
8125
8143
|
minchaGedola() {
|
|
8126
8144
|
return this.getShaahZmanisBasedZman(6.5);
|
|
8127
8145
|
}
|
|
8146
|
+
/**
|
|
8147
|
+
* Earliest Mincha – Mincha Gedola (MGA); Sunrise plus 6.5 halachic hours.
|
|
8148
|
+
* If elevation is enabled, this function will include elevation in the calculation.
|
|
8149
|
+
*
|
|
8150
|
+
* This method returns the time of *mincha gedola* according to the Magen Avraham
|
|
8151
|
+
* with the day starting 72 minutes before sunrise and ending 72 minutes after sunset.
|
|
8152
|
+
* This is the earliest time to pray *mincha*.
|
|
8153
|
+
* @return {Date}
|
|
8154
|
+
*/
|
|
8155
|
+
minchaGedolaMGA() {
|
|
8156
|
+
const [alot72, temporalHour] = this.getTemporalHour72(false);
|
|
8157
|
+
const offset = Math.floor(6.5 * temporalHour);
|
|
8158
|
+
return new Date(alot72.getTime() + offset);
|
|
8159
|
+
}
|
|
8128
8160
|
/**
|
|
8129
8161
|
* Preferable earliest time to recite Minchah – Mincha Ketana; Sunrise plus 9.5 halachic hours.
|
|
8130
8162
|
* If elevation is enabled, this function will include elevation in the calculation.
|
|
8163
|
+
*
|
|
8164
|
+
* This method returns *mincha ketana*, the preferred earliest time to pray *mincha* in the
|
|
8165
|
+
* opinion of the [Rambam](https://en.wikipedia.org/wiki/Maimonides) and others,
|
|
8166
|
+
* that is 9.5 *shaos zmaniyos* (solar hours) after sunrise or sea level sunrise
|
|
8167
|
+
* (depending on the `useElevation` setting), according
|
|
8168
|
+
* to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).
|
|
8131
8169
|
* @return {Date}
|
|
8132
8170
|
*/
|
|
8133
8171
|
minchaKetana() {
|
|
8134
8172
|
return this.getShaahZmanisBasedZman(9.5);
|
|
8135
8173
|
}
|
|
8174
|
+
/**
|
|
8175
|
+
* This method returns the time of *mincha ketana* according to the Magen Avraham
|
|
8176
|
+
* with the day starting 72 minutes before sunrise and ending 72 minutes after sunset.
|
|
8177
|
+
* This is the preferred earliest time to pray *mincha* according to the opinion of
|
|
8178
|
+
* the [Rambam](https://en.wikipedia.org/wiki/Maimonides) and others.
|
|
8179
|
+
*
|
|
8180
|
+
* If elevation is enabled, this function will include elevation in the calculation.
|
|
8181
|
+
* @return {Date}
|
|
8182
|
+
*/
|
|
8183
|
+
minchaKetanaMGA() {
|
|
8184
|
+
const [alot72, temporalHour] = this.getTemporalHour72(false);
|
|
8185
|
+
return new Date(alot72.getTime() + Math.floor(9.5 * temporalHour));
|
|
8186
|
+
}
|
|
8136
8187
|
/**
|
|
8137
8188
|
* Plag haMincha; Sunrise plus 10.75 halachic hours.
|
|
8138
8189
|
* If elevation is enabled, this function will include elevation in the calculation.
|
|
@@ -8631,13 +8682,6 @@ class OmerEvent extends Event {
|
|
|
8631
8682
|
}
|
|
8632
8683
|
|
|
8633
8684
|
class QuickLRU extends Map {
|
|
8634
|
-
#size = 0;
|
|
8635
|
-
#cache = new Map();
|
|
8636
|
-
#oldCache = new Map();
|
|
8637
|
-
#maxSize;
|
|
8638
|
-
#maxAge;
|
|
8639
|
-
#onEviction;
|
|
8640
|
-
|
|
8641
8685
|
constructor(options = {}) {
|
|
8642
8686
|
super();
|
|
8643
8687
|
|
|
@@ -8649,30 +8693,30 @@ class QuickLRU extends Map {
|
|
|
8649
8693
|
throw new TypeError('`maxAge` must be a number greater than 0');
|
|
8650
8694
|
}
|
|
8651
8695
|
|
|
8652
|
-
|
|
8653
|
-
this
|
|
8654
|
-
this
|
|
8696
|
+
// TODO: Use private class fields when ESLint supports them.
|
|
8697
|
+
this.maxSize = options.maxSize;
|
|
8698
|
+
this.maxAge = options.maxAge || Number.POSITIVE_INFINITY;
|
|
8699
|
+
this.onEviction = options.onEviction;
|
|
8700
|
+
this.cache = new Map();
|
|
8701
|
+
this.oldCache = new Map();
|
|
8702
|
+
this._size = 0;
|
|
8655
8703
|
}
|
|
8656
8704
|
|
|
8657
|
-
//
|
|
8658
|
-
|
|
8659
|
-
|
|
8660
|
-
}
|
|
8661
|
-
|
|
8662
|
-
#emitEvictions(cache) {
|
|
8663
|
-
if (typeof this.#onEviction !== 'function') {
|
|
8705
|
+
// TODO: Use private class methods when targeting Node.js 16.
|
|
8706
|
+
_emitEvictions(cache) {
|
|
8707
|
+
if (typeof this.onEviction !== 'function') {
|
|
8664
8708
|
return;
|
|
8665
8709
|
}
|
|
8666
8710
|
|
|
8667
8711
|
for (const [key, item] of cache) {
|
|
8668
|
-
this
|
|
8712
|
+
this.onEviction(key, item.value);
|
|
8669
8713
|
}
|
|
8670
8714
|
}
|
|
8671
8715
|
|
|
8672
|
-
|
|
8716
|
+
_deleteIfExpired(key, item) {
|
|
8673
8717
|
if (typeof item.expiry === 'number' && item.expiry <= Date.now()) {
|
|
8674
|
-
if (typeof this
|
|
8675
|
-
this
|
|
8718
|
+
if (typeof this.onEviction === 'function') {
|
|
8719
|
+
this.onEviction(key, item.value);
|
|
8676
8720
|
}
|
|
8677
8721
|
|
|
8678
8722
|
return this.delete(key);
|
|
@@ -8681,54 +8725,54 @@ class QuickLRU extends Map {
|
|
|
8681
8725
|
return false;
|
|
8682
8726
|
}
|
|
8683
8727
|
|
|
8684
|
-
|
|
8685
|
-
const deleted = this
|
|
8728
|
+
_getOrDeleteIfExpired(key, item) {
|
|
8729
|
+
const deleted = this._deleteIfExpired(key, item);
|
|
8686
8730
|
if (deleted === false) {
|
|
8687
8731
|
return item.value;
|
|
8688
8732
|
}
|
|
8689
8733
|
}
|
|
8690
8734
|
|
|
8691
|
-
|
|
8692
|
-
return item.expiry ? this
|
|
8735
|
+
_getItemValue(key, item) {
|
|
8736
|
+
return item.expiry ? this._getOrDeleteIfExpired(key, item) : item.value;
|
|
8693
8737
|
}
|
|
8694
8738
|
|
|
8695
|
-
|
|
8739
|
+
_peek(key, cache) {
|
|
8696
8740
|
const item = cache.get(key);
|
|
8697
8741
|
|
|
8698
|
-
return this
|
|
8742
|
+
return this._getItemValue(key, item);
|
|
8699
8743
|
}
|
|
8700
8744
|
|
|
8701
|
-
|
|
8702
|
-
this
|
|
8703
|
-
this
|
|
8745
|
+
_set(key, value) {
|
|
8746
|
+
this.cache.set(key, value);
|
|
8747
|
+
this._size++;
|
|
8704
8748
|
|
|
8705
|
-
if (this
|
|
8706
|
-
this
|
|
8707
|
-
this
|
|
8708
|
-
this
|
|
8709
|
-
this
|
|
8749
|
+
if (this._size >= this.maxSize) {
|
|
8750
|
+
this._size = 0;
|
|
8751
|
+
this._emitEvictions(this.oldCache);
|
|
8752
|
+
this.oldCache = this.cache;
|
|
8753
|
+
this.cache = new Map();
|
|
8710
8754
|
}
|
|
8711
8755
|
}
|
|
8712
8756
|
|
|
8713
|
-
|
|
8714
|
-
this
|
|
8715
|
-
this
|
|
8757
|
+
_moveToRecent(key, item) {
|
|
8758
|
+
this.oldCache.delete(key);
|
|
8759
|
+
this._set(key, item);
|
|
8716
8760
|
}
|
|
8717
8761
|
|
|
8718
|
-
*
|
|
8719
|
-
for (const item of this
|
|
8762
|
+
* _entriesAscending() {
|
|
8763
|
+
for (const item of this.oldCache) {
|
|
8720
8764
|
const [key, value] = item;
|
|
8721
|
-
if (!this
|
|
8722
|
-
const deleted = this
|
|
8765
|
+
if (!this.cache.has(key)) {
|
|
8766
|
+
const deleted = this._deleteIfExpired(key, value);
|
|
8723
8767
|
if (deleted === false) {
|
|
8724
8768
|
yield item;
|
|
8725
8769
|
}
|
|
8726
8770
|
}
|
|
8727
8771
|
}
|
|
8728
8772
|
|
|
8729
|
-
for (const item of this
|
|
8773
|
+
for (const item of this.cache) {
|
|
8730
8774
|
const [key, value] = item;
|
|
8731
|
-
const deleted = this
|
|
8775
|
+
const deleted = this._deleteIfExpired(key, value);
|
|
8732
8776
|
if (deleted === false) {
|
|
8733
8777
|
yield item;
|
|
8734
8778
|
}
|
|
@@ -8736,72 +8780,73 @@ class QuickLRU extends Map {
|
|
|
8736
8780
|
}
|
|
8737
8781
|
|
|
8738
8782
|
get(key) {
|
|
8739
|
-
if (this
|
|
8740
|
-
const item = this
|
|
8741
|
-
|
|
8783
|
+
if (this.cache.has(key)) {
|
|
8784
|
+
const item = this.cache.get(key);
|
|
8785
|
+
|
|
8786
|
+
return this._getItemValue(key, item);
|
|
8742
8787
|
}
|
|
8743
8788
|
|
|
8744
|
-
if (this
|
|
8745
|
-
const item = this
|
|
8746
|
-
if (this
|
|
8747
|
-
this
|
|
8789
|
+
if (this.oldCache.has(key)) {
|
|
8790
|
+
const item = this.oldCache.get(key);
|
|
8791
|
+
if (this._deleteIfExpired(key, item) === false) {
|
|
8792
|
+
this._moveToRecent(key, item);
|
|
8748
8793
|
return item.value;
|
|
8749
8794
|
}
|
|
8750
8795
|
}
|
|
8751
8796
|
}
|
|
8752
8797
|
|
|
8753
|
-
set(key, value, {maxAge = this
|
|
8754
|
-
const expiry =
|
|
8755
|
-
|
|
8756
|
-
|
|
8757
|
-
|
|
8758
|
-
if (this
|
|
8759
|
-
this
|
|
8798
|
+
set(key, value, {maxAge = this.maxAge} = {}) {
|
|
8799
|
+
const expiry =
|
|
8800
|
+
typeof maxAge === 'number' && maxAge !== Number.POSITIVE_INFINITY ?
|
|
8801
|
+
Date.now() + maxAge :
|
|
8802
|
+
undefined;
|
|
8803
|
+
if (this.cache.has(key)) {
|
|
8804
|
+
this.cache.set(key, {
|
|
8760
8805
|
value,
|
|
8761
|
-
expiry
|
|
8806
|
+
expiry
|
|
8762
8807
|
});
|
|
8763
8808
|
} else {
|
|
8764
|
-
this
|
|
8809
|
+
this._set(key, {value, expiry});
|
|
8765
8810
|
}
|
|
8766
8811
|
|
|
8767
8812
|
return this;
|
|
8768
8813
|
}
|
|
8769
8814
|
|
|
8770
8815
|
has(key) {
|
|
8771
|
-
if (this
|
|
8772
|
-
return !this
|
|
8816
|
+
if (this.cache.has(key)) {
|
|
8817
|
+
return !this._deleteIfExpired(key, this.cache.get(key));
|
|
8773
8818
|
}
|
|
8774
8819
|
|
|
8775
|
-
if (this
|
|
8776
|
-
return !this
|
|
8820
|
+
if (this.oldCache.has(key)) {
|
|
8821
|
+
return !this._deleteIfExpired(key, this.oldCache.get(key));
|
|
8777
8822
|
}
|
|
8778
8823
|
|
|
8779
8824
|
return false;
|
|
8780
8825
|
}
|
|
8781
8826
|
|
|
8782
8827
|
peek(key) {
|
|
8783
|
-
if (this
|
|
8784
|
-
return this
|
|
8828
|
+
if (this.cache.has(key)) {
|
|
8829
|
+
return this._peek(key, this.cache);
|
|
8785
8830
|
}
|
|
8786
8831
|
|
|
8787
|
-
if (this
|
|
8788
|
-
return this
|
|
8832
|
+
if (this.oldCache.has(key)) {
|
|
8833
|
+
return this._peek(key, this.oldCache);
|
|
8789
8834
|
}
|
|
8790
8835
|
}
|
|
8791
8836
|
|
|
8792
8837
|
delete(key) {
|
|
8793
|
-
const deleted = this
|
|
8838
|
+
const deleted = this.cache.delete(key);
|
|
8794
8839
|
if (deleted) {
|
|
8795
|
-
this
|
|
8840
|
+
this._size--;
|
|
8796
8841
|
}
|
|
8797
8842
|
|
|
8798
|
-
return this
|
|
8843
|
+
return this.oldCache.delete(key) || deleted;
|
|
8799
8844
|
}
|
|
8800
8845
|
|
|
8801
8846
|
clear() {
|
|
8802
|
-
this
|
|
8803
|
-
this
|
|
8804
|
-
this
|
|
8847
|
+
this.cache.clear();
|
|
8848
|
+
this.oldCache.clear();
|
|
8849
|
+
this._size = 0;
|
|
8805
8850
|
}
|
|
8806
8851
|
|
|
8807
8852
|
resize(newSize) {
|
|
@@ -8809,23 +8854,23 @@ class QuickLRU extends Map {
|
|
|
8809
8854
|
throw new TypeError('`maxSize` must be a number greater than 0');
|
|
8810
8855
|
}
|
|
8811
8856
|
|
|
8812
|
-
const items = [...this
|
|
8857
|
+
const items = [...this._entriesAscending()];
|
|
8813
8858
|
const removeCount = items.length - newSize;
|
|
8814
8859
|
if (removeCount < 0) {
|
|
8815
|
-
this
|
|
8816
|
-
this
|
|
8817
|
-
this
|
|
8860
|
+
this.cache = new Map(items);
|
|
8861
|
+
this.oldCache = new Map();
|
|
8862
|
+
this._size = items.length;
|
|
8818
8863
|
} else {
|
|
8819
8864
|
if (removeCount > 0) {
|
|
8820
|
-
this
|
|
8865
|
+
this._emitEvictions(items.slice(0, removeCount));
|
|
8821
8866
|
}
|
|
8822
8867
|
|
|
8823
|
-
this
|
|
8824
|
-
this
|
|
8825
|
-
this
|
|
8868
|
+
this.oldCache = new Map(items.slice(removeCount));
|
|
8869
|
+
this.cache = new Map();
|
|
8870
|
+
this._size = 0;
|
|
8826
8871
|
}
|
|
8827
8872
|
|
|
8828
|
-
this
|
|
8873
|
+
this.maxSize = newSize;
|
|
8829
8874
|
}
|
|
8830
8875
|
|
|
8831
8876
|
* keys() {
|
|
@@ -8841,18 +8886,18 @@ class QuickLRU extends Map {
|
|
|
8841
8886
|
}
|
|
8842
8887
|
|
|
8843
8888
|
* [Symbol.iterator]() {
|
|
8844
|
-
for (const item of this
|
|
8889
|
+
for (const item of this.cache) {
|
|
8845
8890
|
const [key, value] = item;
|
|
8846
|
-
const deleted = this
|
|
8891
|
+
const deleted = this._deleteIfExpired(key, value);
|
|
8847
8892
|
if (deleted === false) {
|
|
8848
8893
|
yield [key, value.value];
|
|
8849
8894
|
}
|
|
8850
8895
|
}
|
|
8851
8896
|
|
|
8852
|
-
for (const item of this
|
|
8897
|
+
for (const item of this.oldCache) {
|
|
8853
8898
|
const [key, value] = item;
|
|
8854
|
-
if (!this
|
|
8855
|
-
const deleted = this
|
|
8899
|
+
if (!this.cache.has(key)) {
|
|
8900
|
+
const deleted = this._deleteIfExpired(key, value);
|
|
8856
8901
|
if (deleted === false) {
|
|
8857
8902
|
yield [key, value.value];
|
|
8858
8903
|
}
|
|
@@ -8861,22 +8906,22 @@ class QuickLRU extends Map {
|
|
|
8861
8906
|
}
|
|
8862
8907
|
|
|
8863
8908
|
* entriesDescending() {
|
|
8864
|
-
let items = [...this
|
|
8909
|
+
let items = [...this.cache];
|
|
8865
8910
|
for (let i = items.length - 1; i >= 0; --i) {
|
|
8866
8911
|
const item = items[i];
|
|
8867
8912
|
const [key, value] = item;
|
|
8868
|
-
const deleted = this
|
|
8913
|
+
const deleted = this._deleteIfExpired(key, value);
|
|
8869
8914
|
if (deleted === false) {
|
|
8870
8915
|
yield [key, value.value];
|
|
8871
8916
|
}
|
|
8872
8917
|
}
|
|
8873
8918
|
|
|
8874
|
-
items = [...this
|
|
8919
|
+
items = [...this.oldCache];
|
|
8875
8920
|
for (let i = items.length - 1; i >= 0; --i) {
|
|
8876
8921
|
const item = items[i];
|
|
8877
8922
|
const [key, value] = item;
|
|
8878
|
-
if (!this
|
|
8879
|
-
const deleted = this
|
|
8923
|
+
if (!this.cache.has(key)) {
|
|
8924
|
+
const deleted = this._deleteIfExpired(key, value);
|
|
8880
8925
|
if (deleted === false) {
|
|
8881
8926
|
yield [key, value.value];
|
|
8882
8927
|
}
|
|
@@ -8885,28 +8930,24 @@ class QuickLRU extends Map {
|
|
|
8885
8930
|
}
|
|
8886
8931
|
|
|
8887
8932
|
* entriesAscending() {
|
|
8888
|
-
for (const [key, value] of this
|
|
8933
|
+
for (const [key, value] of this._entriesAscending()) {
|
|
8889
8934
|
yield [key, value.value];
|
|
8890
8935
|
}
|
|
8891
8936
|
}
|
|
8892
8937
|
|
|
8893
8938
|
get size() {
|
|
8894
|
-
if (!this
|
|
8895
|
-
return this
|
|
8939
|
+
if (!this._size) {
|
|
8940
|
+
return this.oldCache.size;
|
|
8896
8941
|
}
|
|
8897
8942
|
|
|
8898
8943
|
let oldCacheSize = 0;
|
|
8899
|
-
for (const key of this
|
|
8900
|
-
if (!this
|
|
8944
|
+
for (const key of this.oldCache.keys()) {
|
|
8945
|
+
if (!this.cache.has(key)) {
|
|
8901
8946
|
oldCacheSize++;
|
|
8902
8947
|
}
|
|
8903
8948
|
}
|
|
8904
8949
|
|
|
8905
|
-
return Math.min(this
|
|
8906
|
-
}
|
|
8907
|
-
|
|
8908
|
-
get maxSize() {
|
|
8909
|
-
return this.#maxSize;
|
|
8950
|
+
return Math.min(this._size + oldCacheSize, this.maxSize);
|
|
8910
8951
|
}
|
|
8911
8952
|
|
|
8912
8953
|
entries() {
|
|
@@ -8958,6 +8999,19 @@ class QuickLRU extends Map {
|
|
|
8958
8999
|
const INCOMPLETE = 0;
|
|
8959
9000
|
const REGULAR = 1;
|
|
8960
9001
|
const COMPLETE = 2;
|
|
9002
|
+
function yearType(hyear) {
|
|
9003
|
+
const longC = HDate.longCheshvan(hyear);
|
|
9004
|
+
const shortK = HDate.shortKislev(hyear);
|
|
9005
|
+
if (longC && !shortK) {
|
|
9006
|
+
return COMPLETE;
|
|
9007
|
+
}
|
|
9008
|
+
else if (!longC && shortK) {
|
|
9009
|
+
return INCOMPLETE;
|
|
9010
|
+
}
|
|
9011
|
+
else {
|
|
9012
|
+
return REGULAR;
|
|
9013
|
+
}
|
|
9014
|
+
}
|
|
8961
9015
|
/**
|
|
8962
9016
|
* Represents Parashah HaShavua for an entire Hebrew year
|
|
8963
9017
|
*/
|
|
@@ -8969,11 +9023,6 @@ class Sedra {
|
|
|
8969
9023
|
*/
|
|
8970
9024
|
constructor(hyear, il) {
|
|
8971
9025
|
hyear = +hyear;
|
|
8972
|
-
const longC = HDate.longCheshvan(hyear);
|
|
8973
|
-
const shortK = HDate.shortKislev(hyear);
|
|
8974
|
-
const type = (longC && !shortK) ? COMPLETE :
|
|
8975
|
-
(!longC && shortK) ? INCOMPLETE :
|
|
8976
|
-
REGULAR;
|
|
8977
9026
|
this.year = hyear;
|
|
8978
9027
|
const rh0 = new HDate(1, months.TISHREI, hyear);
|
|
8979
9028
|
const rh = rh0.abs();
|
|
@@ -8982,6 +9031,7 @@ class Sedra {
|
|
|
8982
9031
|
this.firstSaturday = HDate.dayOnOrBefore(6, rh + 6);
|
|
8983
9032
|
const leap = +HDate.isLeapYear(hyear);
|
|
8984
9033
|
this.il = Boolean(il);
|
|
9034
|
+
const type = yearType(hyear);
|
|
8985
9035
|
let key = `${leap}${rhDay}${type}`;
|
|
8986
9036
|
if (types[key]) {
|
|
8987
9037
|
this.theSedraArray = types[key];
|
|
@@ -9234,7 +9284,6 @@ const YK = 'Yom Kippur'; // 1
|
|
|
9234
9284
|
const SUKKOT = 'Sukkot'; // 0
|
|
9235
9285
|
const CHMSUKOT = 'Sukkot Shabbat Chol ha-Moed'; // 0
|
|
9236
9286
|
const SHMINI = 'Shmini Atzeret'; // 0
|
|
9237
|
-
const EOY = CHMSUKOT; // always Sukkot day 3, 5 or 6
|
|
9238
9287
|
const PESACH = 'Pesach'; // 25
|
|
9239
9288
|
const PESACH1 = 'Pesach I';
|
|
9240
9289
|
const CHMPESACH = 'Pesach Shabbat Chol ha-Moed'; // 25
|
|
@@ -9251,75 +9300,81 @@ const SHAVUOT$1 = 'Shavuot'; // 33
|
|
|
9251
9300
|
function range$1(start, stop) {
|
|
9252
9301
|
return Array.from({ length: stop - start + 1 }, (v, k) => k + start);
|
|
9253
9302
|
}
|
|
9254
|
-
const
|
|
9303
|
+
const yearStartVayeilech = [51, 52, CHMSUKOT];
|
|
9304
|
+
const yearStartHaazinu = [52, YK, CHMSUKOT];
|
|
9305
|
+
const yearStartRH = [RH, 52, SUKKOT, SHMINI];
|
|
9306
|
+
const r020 = range$1(0, 20);
|
|
9307
|
+
const r027 = range$1(0, 27);
|
|
9308
|
+
const r3340 = range$1(33, 40);
|
|
9309
|
+
const r4349 = range$1(43, 49);
|
|
9310
|
+
const r4350 = range$1(43, 50);
|
|
9255
9311
|
/**
|
|
9256
9312
|
* The ordinary year types (keviot)
|
|
9257
9313
|
* names are leap/nonleap - day - incomplete/regular/complete - diaspora/Israel
|
|
9258
9314
|
* @private
|
|
9259
9315
|
* @readonly
|
|
9260
|
-
* @type {Object.<string, NumberOrString[]>}
|
|
9261
9316
|
*/
|
|
9262
9317
|
const types = {
|
|
9263
9318
|
/* Hebrew year that starts on Monday, is `incomplete' (Heshvan and
|
|
9264
9319
|
* Kislev each have 29 days), and has Passover start on Tuesday. */
|
|
9265
9320
|
// e.g. 5753
|
|
9266
|
-
'020':
|
|
9321
|
+
'020': yearStartVayeilech.concat(r020, D(21), 23, 24, PESACH, 25, D(26), D(28), 30, D(31), r3340, D(41), r4349, D(50)),
|
|
9267
9322
|
/* Hebrew year that starts on Monday, is `complete' (Heshvan and
|
|
9268
9323
|
* Kislev each have 30 days), and has Passover start on Thursday. */
|
|
9269
9324
|
// e.g. 5756
|
|
9270
|
-
'0220':
|
|
9325
|
+
'0220': yearStartVayeilech.concat(r020, D(21), 23, 24, PESACH, 25, D(26), D(28), 30, D(31), 33, SHAVUOT$1, range$1(34, 37), D(38), 40, D(41), r4349, D(50)),
|
|
9271
9326
|
/* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29
|
|
9272
9327
|
* days and Kislev has 30 days), and has Passover start on Saturday. */
|
|
9273
9328
|
// e.g. 5701
|
|
9274
|
-
'0510':
|
|
9329
|
+
'0510': yearStartHaazinu.concat(r020, D(21), 23, 24, PESACH1, PESACH8, 25, D(26), D(28), 30, D(31), r3340, D(41), r4350),
|
|
9275
9330
|
/* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29
|
|
9276
9331
|
* days and Kislev has 30 days), and has Passover start on Saturday. */
|
|
9277
9332
|
// e.g. 5745
|
|
9278
|
-
'0511':
|
|
9333
|
+
'0511': yearStartHaazinu.concat(r020, D(21), 23, 24, PESACH, 25, D(26), D(28), range$1(30, 40), D(41), r4350),
|
|
9279
9334
|
/* Hebrew year that starts on Thursday, is `complete' (Heshvan and
|
|
9280
9335
|
* Kislev each have 30 days), and has Passover start on Sunday. */
|
|
9281
9336
|
// e.g. 5754
|
|
9282
|
-
'052':
|
|
9337
|
+
'052': yearStartHaazinu.concat(range$1(0, 24), PESACH7, 25, D(26), D(28), 30, D(31), r3340, D(41), r4350),
|
|
9283
9338
|
/* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and Kislev
|
|
9284
9339
|
* each have 29 days), and has Passover start on Sunday. */
|
|
9285
9340
|
// e.g. 5761
|
|
9286
|
-
'070':
|
|
9341
|
+
'070': yearStartRH.concat(r020, D(21), 23, 24, PESACH7, 25, D(26), D(28), 30, D(31), r3340, D(41), r4350),
|
|
9287
9342
|
/* Hebrew year that starts on Saturday, is `complete' (Heshvan and
|
|
9288
9343
|
* Kislev each have 30 days), and has Passover start on Tuesday. */
|
|
9289
9344
|
// e.g. 5716
|
|
9290
|
-
'072':
|
|
9345
|
+
'072': yearStartRH.concat(r020, D(21), 23, 24, CHMPESACH, 25, D(26), D(28), 30, D(31), r3340, D(41), r4349, D(50)),
|
|
9291
9346
|
/* -- The leap year types (keviot) -- */
|
|
9292
9347
|
/* Hebrew year that starts on Monday, is `incomplete' (Heshvan and
|
|
9293
9348
|
* Kislev each have 29 days), and has Passover start on Thursday. */
|
|
9294
9349
|
// e.g. 5746
|
|
9295
|
-
'1200':
|
|
9350
|
+
'1200': yearStartVayeilech.concat(r027, CHMPESACH, range$1(28, 33), SHAVUOT$1, range$1(34, 37), D(38), 40, D(41), r4349, D(50)),
|
|
9296
9351
|
/* Hebrew year that starts on Monday, is `incomplete' (Heshvan and
|
|
9297
9352
|
* Kislev each have 29 days), and has Passover start on Thursday. */
|
|
9298
9353
|
// e.g. 5746
|
|
9299
|
-
'1201':
|
|
9354
|
+
'1201': yearStartVayeilech.concat(r027, CHMPESACH, range$1(28, 40), D(41), r4349, D(50)),
|
|
9300
9355
|
/* Hebrew year that starts on Monday, is `complete' (Heshvan and
|
|
9301
9356
|
* Kislev each have 30 days), and has Passover start on Saturday. */
|
|
9302
9357
|
// e.g.5752
|
|
9303
|
-
'1220':
|
|
9358
|
+
'1220': yearStartVayeilech.concat(r027, PESACH1, PESACH8, range$1(28, 40), D(41), r4350),
|
|
9304
9359
|
/* Hebrew year that starts on Monday, is `complete' (Heshvan and
|
|
9305
9360
|
* Kislev each have 30 days), and has Passover start on Saturday. */
|
|
9306
9361
|
// e.g.5752
|
|
9307
|
-
'1221':
|
|
9362
|
+
'1221': yearStartVayeilech.concat(r027, PESACH, range$1(28, 50)),
|
|
9308
9363
|
/* Hebrew year that starts on Thursday, is `incomplete' (Heshvan and
|
|
9309
9364
|
* Kislev both have 29 days), and has Passover start on Sunday. */
|
|
9310
9365
|
// e.g. 5768
|
|
9311
|
-
'150':
|
|
9366
|
+
'150': yearStartHaazinu.concat(range$1(0, 28), PESACH7, range$1(29, 50)),
|
|
9312
9367
|
/* Hebrew year that starts on Thursday, is `complete' (Heshvan and
|
|
9313
9368
|
* Kislev both have 30 days), and has Passover start on Tuesday. */
|
|
9314
9369
|
// eg. 5771
|
|
9315
|
-
'152':
|
|
9370
|
+
'152': yearStartHaazinu.concat(range$1(0, 28), CHMPESACH, range$1(29, 49), D(50)),
|
|
9316
9371
|
/* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and
|
|
9317
9372
|
* Kislev each have 29 days), and has Passover start on Tuesday. */
|
|
9318
9373
|
// e.g.5757
|
|
9319
|
-
'170':
|
|
9374
|
+
'170': yearStartRH.concat(r027, CHMPESACH, range$1(28, 40), D(41), r4349, D(50)),
|
|
9320
9375
|
/* Hebrew year that starts on Saturday, is `complete' (Heshvan and
|
|
9321
9376
|
* Kislev each have 30 days), and has Passover start on Thursday. */
|
|
9322
|
-
'1720':
|
|
9377
|
+
'1720': yearStartRH.concat(r027, CHMPESACH, range$1(28, 33), SHAVUOT$1, range$1(34, 37), D(38), 40, D(41), r4349, D(50)),
|
|
9323
9378
|
};
|
|
9324
9379
|
/* Hebrew year that starts on Monday, is `complete' (Heshvan and
|
|
9325
9380
|
* Kislev each have 30 days), and has Passover start on Thursday. */
|
|
@@ -9343,6 +9398,8 @@ types['1311'] = types['1221'];
|
|
|
9343
9398
|
types['1721'] = types['170'];
|
|
9344
9399
|
const sedraCache = new QuickLRU({ maxSize: 400 });
|
|
9345
9400
|
/**
|
|
9401
|
+
* Convenience function to create an instance of `Sedra` or reuse a previously
|
|
9402
|
+
* created and cached instance.
|
|
9346
9403
|
* @private
|
|
9347
9404
|
* @param {number} hyear
|
|
9348
9405
|
* @param {boolean} il
|
|
@@ -10007,7 +10064,7 @@ class DailyLearning {
|
|
|
10007
10064
|
}
|
|
10008
10065
|
|
|
10009
10066
|
/** DO NOT EDIT THIS AUTO-GENERATED FILE! */
|
|
10010
|
-
const version = '5.4.
|
|
10067
|
+
const version = '5.4.5';
|
|
10011
10068
|
|
|
10012
10069
|
/* eslint-disable max-len */
|
|
10013
10070
|
/**
|
|
@@ -10863,20 +10920,7 @@ function checkCandleOptions(options) {
|
|
|
10863
10920
|
}
|
|
10864
10921
|
let min = Number(options.candleLightingMins) || 18;
|
|
10865
10922
|
if (location.getIsrael() && Math.abs(min) === 18) {
|
|
10866
|
-
|
|
10867
|
-
if (geoid) {
|
|
10868
|
-
const offset = geoIdCandleOffset[geoid];
|
|
10869
|
-
if (typeof offset === 'number') {
|
|
10870
|
-
min = offset;
|
|
10871
|
-
}
|
|
10872
|
-
}
|
|
10873
|
-
const shortName = location.getShortName();
|
|
10874
|
-
if (shortName) {
|
|
10875
|
-
const offset = israelCityOffset[shortName];
|
|
10876
|
-
if (typeof offset === 'number') {
|
|
10877
|
-
min = offset;
|
|
10878
|
-
}
|
|
10879
|
-
}
|
|
10923
|
+
min = overrideIsraelCandleMins(location, min);
|
|
10880
10924
|
}
|
|
10881
10925
|
options.candleLightingMins = -1 * Math.abs(min);
|
|
10882
10926
|
if (typeof options.havdalahMins === 'number') {
|
|
@@ -10892,6 +10936,23 @@ function checkCandleOptions(options) {
|
|
|
10892
10936
|
options.fastEndDeg = TZEIT_3MEDIUM_STARS;
|
|
10893
10937
|
}
|
|
10894
10938
|
}
|
|
10939
|
+
function overrideIsraelCandleMins(location, min) {
|
|
10940
|
+
const geoid = location.getGeoId();
|
|
10941
|
+
if (geoid) {
|
|
10942
|
+
const offset = geoIdCandleOffset[geoid];
|
|
10943
|
+
if (typeof offset === 'number') {
|
|
10944
|
+
return offset;
|
|
10945
|
+
}
|
|
10946
|
+
}
|
|
10947
|
+
const shortName = location.getShortName();
|
|
10948
|
+
if (shortName) {
|
|
10949
|
+
const offset = israelCityOffset[shortName];
|
|
10950
|
+
if (typeof offset === 'number') {
|
|
10951
|
+
return offset;
|
|
10952
|
+
}
|
|
10953
|
+
}
|
|
10954
|
+
return min;
|
|
10955
|
+
}
|
|
10895
10956
|
/**
|
|
10896
10957
|
* Mask to filter Holiday array
|
|
10897
10958
|
* @private
|