@hebcal/core 5.7.4 → 5.7.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/dist/bundle.js CHANGED
@@ -1,9 +1,9 @@
1
- /*! @hebcal/core v5.7.4 */
1
+ /*! @hebcal/core v5.7.5 */
2
2
  var hebcal = (function (exports) {
3
3
  'use strict';
4
4
 
5
5
  /** DO NOT EDIT THIS AUTO-GENERATED FILE! */
6
- const version = '5.7.4';
6
+ const version = '5.7.5';
7
7
 
8
8
  /* eslint-disable @typescript-eslint/no-namespace, no-inner-declarations */
9
9
  /** @private */
@@ -2292,6 +2292,10 @@ class HebrewDateEvent extends Event {
2292
2292
 
2293
2293
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
2294
2294
 
2295
+ function getDefaultExportFromCjs (x) {
2296
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
2297
+ }
2298
+
2295
2299
  var es_array_includes = {};
2296
2300
 
2297
2301
  var globalThis_1;
@@ -11642,250 +11646,111 @@ function renderParshaName(parsha, locale) {
11642
11646
  return str.normalize();
11643
11647
  }
11644
11648
 
11645
- class QuickLRU extends Map {
11646
- constructor() {
11647
- let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
11648
- super();
11649
- if (!(options.maxSize && options.maxSize > 0)) {
11650
- throw new TypeError('`maxSize` must be a number greater than 0');
11651
- }
11652
- if (typeof options.maxAge === 'number' && options.maxAge === 0) {
11653
- throw new TypeError('`maxAge` must be a number greater than 0');
11654
- }
11655
-
11656
- // TODO: Use private class fields when ESLint supports them.
11657
- this.maxSize = options.maxSize;
11658
- this.maxAge = options.maxAge || Number.POSITIVE_INFINITY;
11659
- this.onEviction = options.onEviction;
11660
- this.cache = new Map();
11661
- this.oldCache = new Map();
11662
- this._size = 0;
11663
- }
11664
-
11665
- // TODO: Use private class methods when targeting Node.js 16.
11666
- _emitEvictions(cache) {
11667
- if (typeof this.onEviction !== 'function') {
11668
- return;
11669
- }
11670
- for (const [key, item] of cache) {
11671
- this.onEviction(key, item.value);
11672
- }
11673
- }
11674
- _deleteIfExpired(key, item) {
11675
- if (typeof item.expiry === 'number' && item.expiry <= Date.now()) {
11676
- if (typeof this.onEviction === 'function') {
11677
- this.onEviction(key, item.value);
11649
+ var quickLru;
11650
+ var hasRequiredQuickLru;
11651
+ function requireQuickLru() {
11652
+ if (hasRequiredQuickLru) return quickLru;
11653
+ hasRequiredQuickLru = 1;
11654
+ class QuickLRU {
11655
+ constructor() {
11656
+ let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
11657
+ if (!(options.maxSize && options.maxSize > 0)) {
11658
+ throw new TypeError('`maxSize` must be a number greater than 0');
11678
11659
  }
11679
- return this.delete(key);
11680
- }
11681
- return false;
11682
- }
11683
- _getOrDeleteIfExpired(key, item) {
11684
- const deleted = this._deleteIfExpired(key, item);
11685
- if (deleted === false) {
11686
- return item.value;
11687
- }
11688
- }
11689
- _getItemValue(key, item) {
11690
- return item.expiry ? this._getOrDeleteIfExpired(key, item) : item.value;
11691
- }
11692
- _peek(key, cache) {
11693
- const item = cache.get(key);
11694
- return this._getItemValue(key, item);
11695
- }
11696
- _set(key, value) {
11697
- this.cache.set(key, value);
11698
- this._size++;
11699
- if (this._size >= this.maxSize) {
11700
- this._size = 0;
11701
- this._emitEvictions(this.oldCache);
11702
- this.oldCache = this.cache;
11660
+ this.maxSize = options.maxSize;
11703
11661
  this.cache = new Map();
11662
+ this.oldCache = new Map();
11663
+ this._size = 0;
11704
11664
  }
11705
- }
11706
- _moveToRecent(key, item) {
11707
- this.oldCache.delete(key);
11708
- this._set(key, item);
11709
- }
11710
- *_entriesAscending() {
11711
- for (const item of this.oldCache) {
11712
- const [key, value] = item;
11713
- if (!this.cache.has(key)) {
11714
- const deleted = this._deleteIfExpired(key, value);
11715
- if (deleted === false) {
11716
- yield item;
11717
- }
11665
+ _set(key, value) {
11666
+ this.cache.set(key, value);
11667
+ this._size++;
11668
+ if (this._size >= this.maxSize) {
11669
+ this._size = 0;
11670
+ this.oldCache = this.cache;
11671
+ this.cache = new Map();
11718
11672
  }
11719
11673
  }
11720
- for (const item of this.cache) {
11721
- const [key, value] = item;
11722
- const deleted = this._deleteIfExpired(key, value);
11723
- if (deleted === false) {
11724
- yield item;
11674
+ get(key) {
11675
+ if (this.cache.has(key)) {
11676
+ return this.cache.get(key);
11725
11677
  }
11726
- }
11727
- }
11728
- get(key) {
11729
- if (this.cache.has(key)) {
11730
- const item = this.cache.get(key);
11731
- return this._getItemValue(key, item);
11732
- }
11733
- if (this.oldCache.has(key)) {
11734
- const item = this.oldCache.get(key);
11735
- if (this._deleteIfExpired(key, item) === false) {
11736
- this._moveToRecent(key, item);
11737
- return item.value;
11678
+ if (this.oldCache.has(key)) {
11679
+ const value = this.oldCache.get(key);
11680
+ this.oldCache.delete(key);
11681
+ this._set(key, value);
11682
+ return value;
11738
11683
  }
11739
11684
  }
11740
- }
11741
- set(key, value) {
11742
- let {
11743
- maxAge = this.maxAge
11744
- } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
11745
- const expiry = typeof maxAge === 'number' && maxAge !== Number.POSITIVE_INFINITY ? Date.now() + maxAge : undefined;
11746
- if (this.cache.has(key)) {
11747
- this.cache.set(key, {
11748
- value,
11749
- expiry
11750
- });
11751
- } else {
11752
- this._set(key, {
11753
- value,
11754
- expiry
11755
- });
11756
- }
11757
- return this;
11758
- }
11759
- has(key) {
11760
- if (this.cache.has(key)) {
11761
- return !this._deleteIfExpired(key, this.cache.get(key));
11762
- }
11763
- if (this.oldCache.has(key)) {
11764
- return !this._deleteIfExpired(key, this.oldCache.get(key));
11765
- }
11766
- return false;
11767
- }
11768
- peek(key) {
11769
- if (this.cache.has(key)) {
11770
- return this._peek(key, this.cache);
11771
- }
11772
- if (this.oldCache.has(key)) {
11773
- return this._peek(key, this.oldCache);
11774
- }
11775
- }
11776
- delete(key) {
11777
- const deleted = this.cache.delete(key);
11778
- if (deleted) {
11779
- this._size--;
11685
+ set(key, value) {
11686
+ if (this.cache.has(key)) {
11687
+ this.cache.set(key, value);
11688
+ } else {
11689
+ this._set(key, value);
11690
+ }
11691
+ return this;
11780
11692
  }
11781
- return this.oldCache.delete(key) || deleted;
11782
- }
11783
- clear() {
11784
- this.cache.clear();
11785
- this.oldCache.clear();
11786
- this._size = 0;
11787
- }
11788
- resize(newSize) {
11789
- if (!(newSize && newSize > 0)) {
11790
- throw new TypeError('`maxSize` must be a number greater than 0');
11693
+ has(key) {
11694
+ return this.cache.has(key) || this.oldCache.has(key);
11791
11695
  }
11792
- const items = [...this._entriesAscending()];
11793
- const removeCount = items.length - newSize;
11794
- if (removeCount < 0) {
11795
- this.cache = new Map(items);
11796
- this.oldCache = new Map();
11797
- this._size = items.length;
11798
- } else {
11799
- if (removeCount > 0) {
11800
- this._emitEvictions(items.slice(0, removeCount));
11696
+ peek(key) {
11697
+ if (this.cache.has(key)) {
11698
+ return this.cache.get(key);
11699
+ }
11700
+ if (this.oldCache.has(key)) {
11701
+ return this.oldCache.get(key);
11801
11702
  }
11802
- this.oldCache = new Map(items.slice(removeCount));
11803
- this.cache = new Map();
11804
- this._size = 0;
11805
11703
  }
11806
- this.maxSize = newSize;
11807
- }
11808
- *keys() {
11809
- for (const [key] of this) {
11810
- yield key;
11704
+ delete(key) {
11705
+ const deleted = this.cache.delete(key);
11706
+ if (deleted) {
11707
+ this._size--;
11708
+ }
11709
+ return this.oldCache.delete(key) || deleted;
11811
11710
  }
11812
- }
11813
- *values() {
11814
- for (const [, value] of this) {
11815
- yield value;
11711
+ clear() {
11712
+ this.cache.clear();
11713
+ this.oldCache.clear();
11714
+ this._size = 0;
11816
11715
  }
11817
- }
11818
- *[Symbol.iterator]() {
11819
- for (const item of this.cache) {
11820
- const [key, value] = item;
11821
- const deleted = this._deleteIfExpired(key, value);
11822
- if (deleted === false) {
11823
- yield [key, value.value];
11716
+ *keys() {
11717
+ for (const [key] of this) {
11718
+ yield key;
11824
11719
  }
11825
11720
  }
11826
- for (const item of this.oldCache) {
11827
- const [key, value] = item;
11828
- if (!this.cache.has(key)) {
11829
- const deleted = this._deleteIfExpired(key, value);
11830
- if (deleted === false) {
11831
- yield [key, value.value];
11832
- }
11721
+ *values() {
11722
+ for (const [, value] of this) {
11723
+ yield value;
11833
11724
  }
11834
11725
  }
11835
- }
11836
- *entriesDescending() {
11837
- let items = [...this.cache];
11838
- for (let i = items.length - 1; i >= 0; --i) {
11839
- const item = items[i];
11840
- const [key, value] = item;
11841
- const deleted = this._deleteIfExpired(key, value);
11842
- if (deleted === false) {
11843
- yield [key, value.value];
11726
+ *[Symbol.iterator]() {
11727
+ for (const item of this.cache) {
11728
+ yield item;
11844
11729
  }
11845
- }
11846
- items = [...this.oldCache];
11847
- for (let i = items.length - 1; i >= 0; --i) {
11848
- const item = items[i];
11849
- const [key, value] = item;
11850
- if (!this.cache.has(key)) {
11851
- const deleted = this._deleteIfExpired(key, value);
11852
- if (deleted === false) {
11853
- yield [key, value.value];
11730
+ for (const item of this.oldCache) {
11731
+ const [key] = item;
11732
+ if (!this.cache.has(key)) {
11733
+ yield item;
11854
11734
  }
11855
11735
  }
11856
11736
  }
11857
- }
11858
- *entriesAscending() {
11859
- for (const [key, value] of this._entriesAscending()) {
11860
- yield [key, value.value];
11861
- }
11862
- }
11863
- get size() {
11864
- if (!this._size) {
11865
- return this.oldCache.size;
11866
- }
11867
- let oldCacheSize = 0;
11868
- for (const key of this.oldCache.keys()) {
11869
- if (!this.cache.has(key)) {
11870
- oldCacheSize++;
11737
+ get size() {
11738
+ let oldCacheSize = 0;
11739
+ for (const key of this.oldCache.keys()) {
11740
+ if (!this.cache.has(key)) {
11741
+ oldCacheSize++;
11742
+ }
11871
11743
  }
11872
- }
11873
- return Math.min(this._size + oldCacheSize, this.maxSize);
11874
- }
11875
- entries() {
11876
- return this.entriesAscending();
11877
- }
11878
- forEach(callbackFunction) {
11879
- let thisArgument = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this;
11880
- for (const [key, value] of this.entriesAscending()) {
11881
- callbackFunction.call(thisArgument, value, key, this);
11744
+ return this._size + oldCacheSize;
11882
11745
  }
11883
11746
  }
11884
- get [Symbol.toStringTag]() {
11885
- return JSON.stringify([...this.entriesAscending()]);
11886
- }
11747
+ quickLru = QuickLRU;
11748
+ return quickLru;
11887
11749
  }
11888
11750
 
11751
+ var quickLruExports = requireQuickLru();
11752
+ var QuickLRU = /*@__PURE__*/getDefaultExportFromCjs(quickLruExports);
11753
+
11889
11754
  /*
11890
11755
  Hebcal - A Jewish Calendar Generator
11891
11756
  Copyright (c) 1994-2020 Danny Sadinoff