jcal-zmanim 1.5.0 → 1.5.1

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/index.cjs CHANGED
@@ -1911,7 +1911,6 @@ _Dafyomi.masechtaList = [
1911
1911
  ];
1912
1912
  var Dafyomi = _Dafyomi;
1913
1913
  // src/JCal/jDate.ts
1914
- var _yearCache = [];
1915
1914
  var JS_START_DATE_ABS = 719163;
1916
1915
  var MS_PER_DAY = 864e5;
1917
1916
  var JS_START_OFFSET = /* @__PURE__ */ new Date(0).getTimezoneOffset();
@@ -3017,15 +3016,7 @@ var yearTypeList = [
3017
3016
  0,
3018
3017
  7
3019
3018
  ];
3020
- var daysUntil5000 = 1825849;
3021
- var getElapsedDaysEarly = function(year) {
3022
- var _yearCache_find;
3023
- var elapsed = (_yearCache_find = _yearCache.find(function(y) {
3024
- return (y === null || y === void 0 ? void 0 : y.year) === year;
3025
- })) === null || _yearCache_find === void 0 ? void 0 : _yearCache_find.elapsed;
3026
- if (elapsed) {
3027
- return elapsed;
3028
- }
3019
+ var getElapsedDays = function(year) {
3029
3020
  var daysCounter = 0;
3030
3021
  var months = Utils.toInt(235 * Utils.toInt((year - 1) / 19) + // Leap months this cycle
3031
3022
  12 * ((year - 1) % 19) + // Regular months in this cycle.
@@ -3038,20 +3029,9 @@ var getElapsedDaysEarly = function(year) {
3038
3029
  if (Utils.has(daysCounter % 7, 0, 3, 5)) {
3039
3030
  daysCounter += 1;
3040
3031
  }
3041
- _yearCache.push({
3042
- year: year,
3043
- elapsed: daysCounter
3044
- });
3045
3032
  return daysCounter;
3046
3033
  };
3047
- var getElapsedDays5000 = function(year) {
3048
- var counter = daysUntil5000;
3049
- for(var y = 5e3; y < year; y++){
3050
- counter += jDate.yearType(y).daysInYear;
3051
- }
3052
- return counter;
3053
- };
3054
- var jDate = /*#__PURE__*/ function() {
3034
+ var _jDate = /*#__PURE__*/ function() {
3055
3035
  function _jDate(arg, month, day, abs) {
3056
3036
  _class_call_check(this, _jDate);
3057
3037
  this.Day = NaN;
@@ -3598,7 +3578,7 @@ var jDate = /*#__PURE__*/ function() {
3598
3578
  m1++;
3599
3579
  }
3600
3580
  }
3601
- return dayInYear + (_jDate.tDays(year) + -1373429);
3581
+ return dayInYear + (getElapsedDays(year) + -1373429);
3602
3582
  }
3603
3583
  },
3604
3584
  {
@@ -3641,16 +3621,6 @@ var jDate = /*#__PURE__*/ function() {
3641
3621
  return 0;
3642
3622
  }
3643
3623
  },
3644
- {
3645
- key: "tDays",
3646
- value: /**Elapsed days since creation of the world until Rosh Hashana of the given year*/ function tDays(year) {
3647
- if (year >= 5e3) {
3648
- return getElapsedDays5000(year);
3649
- } else {
3650
- return getElapsedDaysEarly(year);
3651
- }
3652
- }
3653
- },
3654
3624
  {
3655
3625
  key: "yearType",
3656
3626
  value: /**The index for the year type of the given year.
@@ -3665,7 +3635,7 @@ var jDate = /*#__PURE__*/ function() {
3665
3635
  if (year >= 5e3) {
3666
3636
  return _jDate.yearType(year).daysInYear;
3667
3637
  } else {
3668
- return _jDate.tDays(year + 1) - _jDate.tDays(year);
3638
+ return getElapsedDays(year + 1) - getElapsedDays(year);
3669
3639
  }
3670
3640
  }
3671
3641
  },
@@ -3689,24 +3659,6 @@ var jDate = /*#__PURE__*/ function() {
3689
3659
  }
3690
3660
  }
3691
3661
  },
3692
- {
3693
- key: "daysJYear_",
3694
- value: /**number of days in the given Jewish Year.*/ function daysJYear_(year) {
3695
- return _jDate.yearType(year).daysInYear;
3696
- }
3697
- },
3698
- {
3699
- key: "isLongCheshvan_",
3700
- value: /**Does Cheshvan for the given Jewish Year have 30 days?*/ function isLongCheshvan_(year) {
3701
- return _jDate.yearType(year).isLongCheshvan;
3702
- }
3703
- },
3704
- {
3705
- key: "isShortKislev_",
3706
- value: /**Does Kislev for the given Jewish Year have 29 days?*/ function isShortKislev_(year) {
3707
- return !_jDate.yearType(year).isLongKislev;
3708
- }
3709
- },
3710
3662
  {
3711
3663
  key: "isJdLeapY",
3712
3664
  value: /**Does the given Jewish Year have 13 months?*/ function isJdLeapY(year) {
@@ -3722,6 +3674,8 @@ var jDate = /*#__PURE__*/ function() {
3722
3674
  ]);
3723
3675
  return _jDate;
3724
3676
  }();
3677
+ _jDate.getElapsedDays = getElapsedDays;
3678
+ var jDate = _jDate;
3725
3679
  // src/JCal/Zmanim.ts
3726
3680
  var Zmanim = /*#__PURE__*/ function() {
3727
3681
  function _Zmanim() {