@hebcal/core 5.7.2 → 5.7.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/dist/bundle.js +2 -2
- package/dist/bundle.js.map +1 -1
- package/dist/bundle.min.js +2 -2
- package/dist/bundle.min.js.map +1 -1
- package/dist/{es → esm}/DailyLearning.js +1 -1
- package/dist/{es → esm}/HebrewDateEvent.js +1 -1
- package/dist/{es → esm}/HolidayEvent.js +1 -1
- package/dist/{es → esm}/MevarchimChodeshEvent.js +1 -1
- package/dist/{es → esm}/ParshaEvent.js +1 -1
- package/dist/{es → esm}/TimedEvent.js +1 -1
- package/dist/{es → esm}/YomKippurKatanEvent.js +1 -1
- package/dist/{es → esm}/ashkenazi.po.js +1 -1
- package/dist/{es → esm}/calendar.js +2 -1
- package/dist/esm/calendar.js.map +1 -0
- package/dist/{es → esm}/candles.js +1 -1
- package/dist/{es → esm}/event.js +1 -1
- package/dist/{es → esm}/getStartAndEnd.js +1 -1
- package/dist/{es → esm}/hallel.js +1 -1
- package/dist/{es → esm}/he.po.js +1 -1
- package/dist/{es → esm}/hebcal.js +1 -1
- package/dist/{es → esm}/holidays.js +1 -1
- package/dist/{es → esm}/index.js +1 -1
- package/dist/esm/locale.d.ts +2 -0
- package/dist/{es → esm}/locale.js +2 -1
- package/dist/esm/locale.js.map +1 -0
- package/dist/{es → esm}/location.js +1 -1
- package/dist/{es → esm}/modern.js +1 -1
- package/dist/{es → esm}/molad.js +1 -1
- package/dist/{es → esm}/omer.js +1 -1
- package/dist/{es → esm}/parshaName.d.ts +0 -1
- package/dist/{es → esm}/parshaName.js +2 -2
- package/dist/esm/parshaName.js.map +1 -0
- package/dist/{es → esm}/pkgVersion.d.ts +1 -1
- package/dist/{es → esm}/pkgVersion.js +2 -2
- package/dist/{es → esm}/pkgVersion.js.map +1 -1
- package/dist/{es → esm}/reformatTimeStr.js +1 -1
- package/dist/{es → esm}/sedra.js +1 -1
- package/dist/{es → esm}/staticHolidays.js +1 -1
- package/dist/{es → esm}/tachanun.js +1 -1
- package/dist/{es → esm}/zmanim.js +1 -1
- package/dist/index.cjs +286 -3
- package/dist/index.cjs.map +1 -1
- package/dist/locale.d.ts +2 -1
- package/dist/parshaName.d.ts +0 -1
- package/dist/pkgVersion.d.ts +1 -1
- package/package.json +6 -7
- package/dist/es/calendar.js.map +0 -1
- package/dist/es/locale.d.ts +0 -1
- package/dist/es/locale.js.map +0 -1
- package/dist/es/parshaName.js.map +0 -1
- package/dist/module.d.ts +0 -1618
- /package/dist/{es → esm}/CalOptions.d.ts +0 -0
- /package/dist/{es → esm}/DailyLearning.d.ts +0 -0
- /package/dist/{es → esm}/DailyLearning.js.map +0 -0
- /package/dist/{es → esm}/HebrewDateEvent.d.ts +0 -0
- /package/dist/{es → esm}/HebrewDateEvent.js.map +0 -0
- /package/dist/{es → esm}/HolidayEvent.d.ts +0 -0
- /package/dist/{es → esm}/HolidayEvent.js.map +0 -0
- /package/dist/{es → esm}/MevarchimChodeshEvent.d.ts +0 -0
- /package/dist/{es → esm}/MevarchimChodeshEvent.js.map +0 -0
- /package/dist/{es → esm}/ParshaEvent.d.ts +0 -0
- /package/dist/{es → esm}/ParshaEvent.js.map +0 -0
- /package/dist/{es → esm}/TimedEvent.d.ts +0 -0
- /package/dist/{es → esm}/TimedEvent.js.map +0 -0
- /package/dist/{es → esm}/YomKippurKatanEvent.d.ts +0 -0
- /package/dist/{es → esm}/YomKippurKatanEvent.js.map +0 -0
- /package/dist/{es → esm}/ashkenazi.po.d.ts +0 -0
- /package/dist/{es → esm}/ashkenazi.po.js.map +0 -0
- /package/dist/{es → esm}/calendar.d.ts +0 -0
- /package/dist/{es → esm}/candles.d.ts +0 -0
- /package/dist/{es → esm}/candles.js.map +0 -0
- /package/dist/{es → esm}/event.d.ts +0 -0
- /package/dist/{es → esm}/event.js.map +0 -0
- /package/dist/{es → esm}/getStartAndEnd.d.ts +0 -0
- /package/dist/{es → esm}/getStartAndEnd.js.map +0 -0
- /package/dist/{es → esm}/hallel.d.ts +0 -0
- /package/dist/{es → esm}/hallel.js.map +0 -0
- /package/dist/{es → esm}/he.po.d.ts +0 -0
- /package/dist/{es → esm}/he.po.js.map +0 -0
- /package/dist/{es → esm}/hebcal.d.ts +0 -0
- /package/dist/{es → esm}/hebcal.js.map +0 -0
- /package/dist/{es → esm}/holidays.d.ts +0 -0
- /package/dist/{es → esm}/holidays.js.map +0 -0
- /package/dist/{es → esm}/index.d.ts +0 -0
- /package/dist/{es → esm}/index.js.map +0 -0
- /package/dist/{es → esm}/location.d.ts +0 -0
- /package/dist/{es → esm}/location.js.map +0 -0
- /package/dist/{es → esm}/modern.d.ts +0 -0
- /package/dist/{es → esm}/modern.js.map +0 -0
- /package/dist/{es → esm}/molad.d.ts +0 -0
- /package/dist/{es → esm}/molad.js.map +0 -0
- /package/dist/{es → esm}/omer.d.ts +0 -0
- /package/dist/{es → esm}/omer.js.map +0 -0
- /package/dist/{es → esm}/reformatTimeStr.d.ts +0 -0
- /package/dist/{es → esm}/reformatTimeStr.js.map +0 -0
- /package/dist/{es → esm}/sedra.d.ts +0 -0
- /package/dist/{es → esm}/sedra.js.map +0 -0
- /package/dist/{es → esm}/staticHolidays.d.ts +0 -0
- /package/dist/{es → esm}/staticHolidays.js.map +0 -0
- /package/dist/{es → esm}/tachanun.d.ts +0 -0
- /package/dist/{es → esm}/tachanun.js.map +0 -0
- /package/dist/{es → esm}/zmanim.d.ts +0 -0
- /package/dist/{es → esm}/zmanim.js.map +0 -0
package/dist/index.cjs
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
/*! @hebcal/core v5.7.
|
|
1
|
+
/*! @hebcal/core v5.7.4 */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var hdate = require('@hebcal/hdate');
|
|
5
5
|
var noaa = require('@hebcal/noaa');
|
|
6
6
|
require('temporal-polyfill/global');
|
|
7
|
-
var QuickLRU = require('quick-lru');
|
|
8
7
|
|
|
9
8
|
/** DO NOT EDIT THIS AUTO-GENERATED FILE! */
|
|
10
|
-
const version = '5.7.
|
|
9
|
+
const version = '5.7.4';
|
|
11
10
|
|
|
12
11
|
var poAshkenazi = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);" }, "contexts": { "": { "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"], "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"] } } };
|
|
13
12
|
|
|
@@ -2497,6 +2496,290 @@ function renderParshaName(parsha, locale) {
|
|
|
2497
2496
|
return str.normalize();
|
|
2498
2497
|
}
|
|
2499
2498
|
|
|
2499
|
+
class QuickLRU extends Map {
|
|
2500
|
+
constructor(options = {}) {
|
|
2501
|
+
super();
|
|
2502
|
+
|
|
2503
|
+
if (!(options.maxSize && options.maxSize > 0)) {
|
|
2504
|
+
throw new TypeError('`maxSize` must be a number greater than 0');
|
|
2505
|
+
}
|
|
2506
|
+
|
|
2507
|
+
if (typeof options.maxAge === 'number' && options.maxAge === 0) {
|
|
2508
|
+
throw new TypeError('`maxAge` must be a number greater than 0');
|
|
2509
|
+
}
|
|
2510
|
+
|
|
2511
|
+
// TODO: Use private class fields when ESLint supports them.
|
|
2512
|
+
this.maxSize = options.maxSize;
|
|
2513
|
+
this.maxAge = options.maxAge || Number.POSITIVE_INFINITY;
|
|
2514
|
+
this.onEviction = options.onEviction;
|
|
2515
|
+
this.cache = new Map();
|
|
2516
|
+
this.oldCache = new Map();
|
|
2517
|
+
this._size = 0;
|
|
2518
|
+
}
|
|
2519
|
+
|
|
2520
|
+
// TODO: Use private class methods when targeting Node.js 16.
|
|
2521
|
+
_emitEvictions(cache) {
|
|
2522
|
+
if (typeof this.onEviction !== 'function') {
|
|
2523
|
+
return;
|
|
2524
|
+
}
|
|
2525
|
+
|
|
2526
|
+
for (const [key, item] of cache) {
|
|
2527
|
+
this.onEviction(key, item.value);
|
|
2528
|
+
}
|
|
2529
|
+
}
|
|
2530
|
+
|
|
2531
|
+
_deleteIfExpired(key, item) {
|
|
2532
|
+
if (typeof item.expiry === 'number' && item.expiry <= Date.now()) {
|
|
2533
|
+
if (typeof this.onEviction === 'function') {
|
|
2534
|
+
this.onEviction(key, item.value);
|
|
2535
|
+
}
|
|
2536
|
+
|
|
2537
|
+
return this.delete(key);
|
|
2538
|
+
}
|
|
2539
|
+
|
|
2540
|
+
return false;
|
|
2541
|
+
}
|
|
2542
|
+
|
|
2543
|
+
_getOrDeleteIfExpired(key, item) {
|
|
2544
|
+
const deleted = this._deleteIfExpired(key, item);
|
|
2545
|
+
if (deleted === false) {
|
|
2546
|
+
return item.value;
|
|
2547
|
+
}
|
|
2548
|
+
}
|
|
2549
|
+
|
|
2550
|
+
_getItemValue(key, item) {
|
|
2551
|
+
return item.expiry ? this._getOrDeleteIfExpired(key, item) : item.value;
|
|
2552
|
+
}
|
|
2553
|
+
|
|
2554
|
+
_peek(key, cache) {
|
|
2555
|
+
const item = cache.get(key);
|
|
2556
|
+
|
|
2557
|
+
return this._getItemValue(key, item);
|
|
2558
|
+
}
|
|
2559
|
+
|
|
2560
|
+
_set(key, value) {
|
|
2561
|
+
this.cache.set(key, value);
|
|
2562
|
+
this._size++;
|
|
2563
|
+
|
|
2564
|
+
if (this._size >= this.maxSize) {
|
|
2565
|
+
this._size = 0;
|
|
2566
|
+
this._emitEvictions(this.oldCache);
|
|
2567
|
+
this.oldCache = this.cache;
|
|
2568
|
+
this.cache = new Map();
|
|
2569
|
+
}
|
|
2570
|
+
}
|
|
2571
|
+
|
|
2572
|
+
_moveToRecent(key, item) {
|
|
2573
|
+
this.oldCache.delete(key);
|
|
2574
|
+
this._set(key, item);
|
|
2575
|
+
}
|
|
2576
|
+
|
|
2577
|
+
* _entriesAscending() {
|
|
2578
|
+
for (const item of this.oldCache) {
|
|
2579
|
+
const [key, value] = item;
|
|
2580
|
+
if (!this.cache.has(key)) {
|
|
2581
|
+
const deleted = this._deleteIfExpired(key, value);
|
|
2582
|
+
if (deleted === false) {
|
|
2583
|
+
yield item;
|
|
2584
|
+
}
|
|
2585
|
+
}
|
|
2586
|
+
}
|
|
2587
|
+
|
|
2588
|
+
for (const item of this.cache) {
|
|
2589
|
+
const [key, value] = item;
|
|
2590
|
+
const deleted = this._deleteIfExpired(key, value);
|
|
2591
|
+
if (deleted === false) {
|
|
2592
|
+
yield item;
|
|
2593
|
+
}
|
|
2594
|
+
}
|
|
2595
|
+
}
|
|
2596
|
+
|
|
2597
|
+
get(key) {
|
|
2598
|
+
if (this.cache.has(key)) {
|
|
2599
|
+
const item = this.cache.get(key);
|
|
2600
|
+
|
|
2601
|
+
return this._getItemValue(key, item);
|
|
2602
|
+
}
|
|
2603
|
+
|
|
2604
|
+
if (this.oldCache.has(key)) {
|
|
2605
|
+
const item = this.oldCache.get(key);
|
|
2606
|
+
if (this._deleteIfExpired(key, item) === false) {
|
|
2607
|
+
this._moveToRecent(key, item);
|
|
2608
|
+
return item.value;
|
|
2609
|
+
}
|
|
2610
|
+
}
|
|
2611
|
+
}
|
|
2612
|
+
|
|
2613
|
+
set(key, value, {maxAge = this.maxAge} = {}) {
|
|
2614
|
+
const expiry =
|
|
2615
|
+
typeof maxAge === 'number' && maxAge !== Number.POSITIVE_INFINITY ?
|
|
2616
|
+
Date.now() + maxAge :
|
|
2617
|
+
undefined;
|
|
2618
|
+
if (this.cache.has(key)) {
|
|
2619
|
+
this.cache.set(key, {
|
|
2620
|
+
value,
|
|
2621
|
+
expiry
|
|
2622
|
+
});
|
|
2623
|
+
} else {
|
|
2624
|
+
this._set(key, {value, expiry});
|
|
2625
|
+
}
|
|
2626
|
+
|
|
2627
|
+
return this;
|
|
2628
|
+
}
|
|
2629
|
+
|
|
2630
|
+
has(key) {
|
|
2631
|
+
if (this.cache.has(key)) {
|
|
2632
|
+
return !this._deleteIfExpired(key, this.cache.get(key));
|
|
2633
|
+
}
|
|
2634
|
+
|
|
2635
|
+
if (this.oldCache.has(key)) {
|
|
2636
|
+
return !this._deleteIfExpired(key, this.oldCache.get(key));
|
|
2637
|
+
}
|
|
2638
|
+
|
|
2639
|
+
return false;
|
|
2640
|
+
}
|
|
2641
|
+
|
|
2642
|
+
peek(key) {
|
|
2643
|
+
if (this.cache.has(key)) {
|
|
2644
|
+
return this._peek(key, this.cache);
|
|
2645
|
+
}
|
|
2646
|
+
|
|
2647
|
+
if (this.oldCache.has(key)) {
|
|
2648
|
+
return this._peek(key, this.oldCache);
|
|
2649
|
+
}
|
|
2650
|
+
}
|
|
2651
|
+
|
|
2652
|
+
delete(key) {
|
|
2653
|
+
const deleted = this.cache.delete(key);
|
|
2654
|
+
if (deleted) {
|
|
2655
|
+
this._size--;
|
|
2656
|
+
}
|
|
2657
|
+
|
|
2658
|
+
return this.oldCache.delete(key) || deleted;
|
|
2659
|
+
}
|
|
2660
|
+
|
|
2661
|
+
clear() {
|
|
2662
|
+
this.cache.clear();
|
|
2663
|
+
this.oldCache.clear();
|
|
2664
|
+
this._size = 0;
|
|
2665
|
+
}
|
|
2666
|
+
|
|
2667
|
+
resize(newSize) {
|
|
2668
|
+
if (!(newSize && newSize > 0)) {
|
|
2669
|
+
throw new TypeError('`maxSize` must be a number greater than 0');
|
|
2670
|
+
}
|
|
2671
|
+
|
|
2672
|
+
const items = [...this._entriesAscending()];
|
|
2673
|
+
const removeCount = items.length - newSize;
|
|
2674
|
+
if (removeCount < 0) {
|
|
2675
|
+
this.cache = new Map(items);
|
|
2676
|
+
this.oldCache = new Map();
|
|
2677
|
+
this._size = items.length;
|
|
2678
|
+
} else {
|
|
2679
|
+
if (removeCount > 0) {
|
|
2680
|
+
this._emitEvictions(items.slice(0, removeCount));
|
|
2681
|
+
}
|
|
2682
|
+
|
|
2683
|
+
this.oldCache = new Map(items.slice(removeCount));
|
|
2684
|
+
this.cache = new Map();
|
|
2685
|
+
this._size = 0;
|
|
2686
|
+
}
|
|
2687
|
+
|
|
2688
|
+
this.maxSize = newSize;
|
|
2689
|
+
}
|
|
2690
|
+
|
|
2691
|
+
* keys() {
|
|
2692
|
+
for (const [key] of this) {
|
|
2693
|
+
yield key;
|
|
2694
|
+
}
|
|
2695
|
+
}
|
|
2696
|
+
|
|
2697
|
+
* values() {
|
|
2698
|
+
for (const [, value] of this) {
|
|
2699
|
+
yield value;
|
|
2700
|
+
}
|
|
2701
|
+
}
|
|
2702
|
+
|
|
2703
|
+
* [Symbol.iterator]() {
|
|
2704
|
+
for (const item of this.cache) {
|
|
2705
|
+
const [key, value] = item;
|
|
2706
|
+
const deleted = this._deleteIfExpired(key, value);
|
|
2707
|
+
if (deleted === false) {
|
|
2708
|
+
yield [key, value.value];
|
|
2709
|
+
}
|
|
2710
|
+
}
|
|
2711
|
+
|
|
2712
|
+
for (const item of this.oldCache) {
|
|
2713
|
+
const [key, value] = item;
|
|
2714
|
+
if (!this.cache.has(key)) {
|
|
2715
|
+
const deleted = this._deleteIfExpired(key, value);
|
|
2716
|
+
if (deleted === false) {
|
|
2717
|
+
yield [key, value.value];
|
|
2718
|
+
}
|
|
2719
|
+
}
|
|
2720
|
+
}
|
|
2721
|
+
}
|
|
2722
|
+
|
|
2723
|
+
* entriesDescending() {
|
|
2724
|
+
let items = [...this.cache];
|
|
2725
|
+
for (let i = items.length - 1; i >= 0; --i) {
|
|
2726
|
+
const item = items[i];
|
|
2727
|
+
const [key, value] = item;
|
|
2728
|
+
const deleted = this._deleteIfExpired(key, value);
|
|
2729
|
+
if (deleted === false) {
|
|
2730
|
+
yield [key, value.value];
|
|
2731
|
+
}
|
|
2732
|
+
}
|
|
2733
|
+
|
|
2734
|
+
items = [...this.oldCache];
|
|
2735
|
+
for (let i = items.length - 1; i >= 0; --i) {
|
|
2736
|
+
const item = items[i];
|
|
2737
|
+
const [key, value] = item;
|
|
2738
|
+
if (!this.cache.has(key)) {
|
|
2739
|
+
const deleted = this._deleteIfExpired(key, value);
|
|
2740
|
+
if (deleted === false) {
|
|
2741
|
+
yield [key, value.value];
|
|
2742
|
+
}
|
|
2743
|
+
}
|
|
2744
|
+
}
|
|
2745
|
+
}
|
|
2746
|
+
|
|
2747
|
+
* entriesAscending() {
|
|
2748
|
+
for (const [key, value] of this._entriesAscending()) {
|
|
2749
|
+
yield [key, value.value];
|
|
2750
|
+
}
|
|
2751
|
+
}
|
|
2752
|
+
|
|
2753
|
+
get size() {
|
|
2754
|
+
if (!this._size) {
|
|
2755
|
+
return this.oldCache.size;
|
|
2756
|
+
}
|
|
2757
|
+
|
|
2758
|
+
let oldCacheSize = 0;
|
|
2759
|
+
for (const key of this.oldCache.keys()) {
|
|
2760
|
+
if (!this.cache.has(key)) {
|
|
2761
|
+
oldCacheSize++;
|
|
2762
|
+
}
|
|
2763
|
+
}
|
|
2764
|
+
|
|
2765
|
+
return Math.min(this._size + oldCacheSize, this.maxSize);
|
|
2766
|
+
}
|
|
2767
|
+
|
|
2768
|
+
entries() {
|
|
2769
|
+
return this.entriesAscending();
|
|
2770
|
+
}
|
|
2771
|
+
|
|
2772
|
+
forEach(callbackFunction, thisArgument = this) {
|
|
2773
|
+
for (const [key, value] of this.entriesAscending()) {
|
|
2774
|
+
callbackFunction.call(thisArgument, value, key, this);
|
|
2775
|
+
}
|
|
2776
|
+
}
|
|
2777
|
+
|
|
2778
|
+
get [Symbol.toStringTag]() {
|
|
2779
|
+
return JSON.stringify([...this.entriesAscending()]);
|
|
2780
|
+
}
|
|
2781
|
+
}
|
|
2782
|
+
|
|
2500
2783
|
/*
|
|
2501
2784
|
Hebcal - A Jewish Calendar Generator
|
|
2502
2785
|
Copyright (c) 1994-2020 Danny Sadinoff
|