@dereekb/date 13.5.0 → 13.5.2

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.
Files changed (3) hide show
  1. package/index.cjs.js +16 -28
  2. package/index.esm.js +16 -28
  3. package/package.json +5 -5
package/index.cjs.js CHANGED
@@ -14,7 +14,7 @@ function _array_like_to_array$7(arr, len) {
14
14
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
15
15
  return arr2;
16
16
  }
17
- function _array_without_holes$5(arr) {
17
+ function _array_without_holes$4(arr) {
18
18
  if (Array.isArray(arr)) return _array_like_to_array$7(arr);
19
19
  }
20
20
  function _define_property$h(obj, key, value) {
@@ -30,10 +30,10 @@ function _define_property$h(obj, key, value) {
30
30
  }
31
31
  return obj;
32
32
  }
33
- function _iterable_to_array$5(iter) {
33
+ function _iterable_to_array$4(iter) {
34
34
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
35
35
  }
36
- function _non_iterable_spread$5() {
36
+ function _non_iterable_spread$4() {
37
37
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
38
38
  }
39
39
  function _object_spread$e(target) {
@@ -51,8 +51,8 @@ function _object_spread$e(target) {
51
51
  }
52
52
  return target;
53
53
  }
54
- function _to_consumable_array$5(arr) {
55
- return _array_without_holes$5(arr) || _iterable_to_array$5(arr) || _unsupported_iterable_to_array$7(arr) || _non_iterable_spread$5();
54
+ function _to_consumable_array$4(arr) {
55
+ return _array_without_holes$4(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$7(arr) || _non_iterable_spread$4();
56
56
  }
57
57
  function _unsupported_iterable_to_array$7(o, minLen) {
58
58
  if (!o) return;
@@ -606,7 +606,7 @@ function roundDateTo(date, roundToUnit) {
606
606
  * // names === ['Mon', 'Tue']
607
607
  * ```
608
608
  */ function readDaysOfWeekNames(values, readDate, nameFunction) {
609
- return _to_consumable_array$5(readDaysOfWeek(values, readDate)).sort(util.sortNumbersAscendingFunction).map(nameFunction);
609
+ return _to_consumable_array$4(readDaysOfWeek(values, readDate)).sort(util.sortNumbersAscendingFunction).map(nameFunction);
610
610
  }
611
611
  /**
612
612
  * Checks whether the given date falls exactly at midnight (00:00:00.000) in UTC.
@@ -4193,7 +4193,7 @@ function _array_like_to_array$6(arr, len) {
4193
4193
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
4194
4194
  return arr2;
4195
4195
  }
4196
- function _array_without_holes$4(arr) {
4196
+ function _array_without_holes$3(arr) {
4197
4197
  if (Array.isArray(arr)) return _array_like_to_array$6(arr);
4198
4198
  }
4199
4199
  function _define_property$c(obj, key, value) {
@@ -4209,10 +4209,10 @@ function _define_property$c(obj, key, value) {
4209
4209
  }
4210
4210
  return obj;
4211
4211
  }
4212
- function _iterable_to_array$4(iter) {
4212
+ function _iterable_to_array$3(iter) {
4213
4213
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
4214
4214
  }
4215
- function _non_iterable_spread$4() {
4215
+ function _non_iterable_spread$3() {
4216
4216
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4217
4217
  }
4218
4218
  function _object_spread$a(target) {
@@ -4249,8 +4249,8 @@ function _object_spread_props$8(target, source) {
4249
4249
  }
4250
4250
  return target;
4251
4251
  }
4252
- function _to_consumable_array$4(arr) {
4253
- return _array_without_holes$4(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$6(arr) || _non_iterable_spread$4();
4252
+ function _to_consumable_array$3(arr) {
4253
+ return _array_without_holes$3(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$6(arr) || _non_iterable_spread$3();
4254
4254
  }
4255
4255
  function _type_of$4(obj) {
4256
4256
  "@swc/helpers - typeof";
@@ -4806,7 +4806,7 @@ function _unsupported_iterable_to_array$6(o, minLen) {
4806
4806
  * @param input - cells or ranges to group
4807
4807
  * @returns a UniqueDateCellRangeGroup containing the sorted blocks with `i` at 0
4808
4808
  */ function groupUniqueDateCells(input) {
4809
- var blocks = sortDateCellRanges(_to_consumable_array$4(input));
4809
+ var blocks = sortDateCellRanges(_to_consumable_array$3(input));
4810
4810
  var i = 0;
4811
4811
  var to;
4812
4812
  if (blocks.length === 0) {
@@ -6208,9 +6208,6 @@ function _array_like_to_array$5(arr, len) {
6208
6208
  function _array_with_holes$2(arr) {
6209
6209
  if (Array.isArray(arr)) return arr;
6210
6210
  }
6211
- function _array_without_holes$3(arr) {
6212
- if (Array.isArray(arr)) return _array_like_to_array$5(arr);
6213
- }
6214
6211
  function _instanceof(left, right) {
6215
6212
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
6216
6213
  return !!right[Symbol.hasInstance](left);
@@ -6218,9 +6215,6 @@ function _instanceof(left, right) {
6218
6215
  return left instanceof right;
6219
6216
  }
6220
6217
  }
6221
- function _iterable_to_array$3(iter) {
6222
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
6223
- }
6224
6218
  function _iterable_to_array_limit$2(arr, i) {
6225
6219
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
6226
6220
  if (_i == null) return;
@@ -6248,15 +6242,9 @@ function _iterable_to_array_limit$2(arr, i) {
6248
6242
  function _non_iterable_rest$2() {
6249
6243
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
6250
6244
  }
6251
- function _non_iterable_spread$3() {
6252
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
6253
- }
6254
6245
  function _sliced_to_array$2(arr, i) {
6255
6246
  return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$5(arr, i) || _non_iterable_rest$2();
6256
6247
  }
6257
- function _to_consumable_array$3(arr) {
6258
- return _array_without_holes$3(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$5(arr) || _non_iterable_spread$3();
6259
- }
6260
6248
  function _unsupported_iterable_to_array$5(o, minLen) {
6261
6249
  if (!o) return;
6262
6250
  if (typeof o === "string") return _array_like_to_array$5(o, minLen);
@@ -6553,7 +6541,7 @@ function yearWeekCode(dateOrYear, inputWeek) {
6553
6541
  }
6554
6542
  return yearWeekCode;
6555
6543
  });
6556
- var groups = _to_consumable_array$3(map.entries()).map(function(param) {
6544
+ var groups = Array.from(map.entries()).map(function(param) {
6557
6545
  var _param = _sliced_to_array$2(param, 2), week = _param[0], _$items = _param[1];
6558
6546
  return {
6559
6547
  week: week !== null && week !== void 0 ? week : 0,
@@ -6752,7 +6740,7 @@ function _unsupported_iterable_to_array$4(o, minLen) {
6752
6740
  * @param input - schedule day codes to convert (WEEKDAY/WEEKEND shorthand codes are expanded)
6753
6741
  * @returns an EnabledDays object with boolean flags for each day
6754
6742
  */ function enabledDaysFromDateCellScheduleDayCodes(input) {
6755
- var days = expandDateCellScheduleDayCodesToDayOfWeekSet(_to_consumable_array$2(new Set(input)));
6743
+ var days = expandDateCellScheduleDayCodesToDayOfWeekSet(Array.from(new Set(input)));
6756
6744
  return util.enabledDaysFromDaysOfWeek(days);
6757
6745
  }
6758
6746
  /**
@@ -6900,7 +6888,7 @@ var DATE_CELL_SCHEDULE_ENCODED_WEEK_REGEX = /^[0-9]{0,9}$/;
6900
6888
  * @param input - day codes to expand
6901
6889
  * @returns sorted array of individual day codes (1-7 only, no shorthand)
6902
6890
  */ function expandDateCellScheduleDayCodes(input) {
6903
- return _to_consumable_array$2(expandDateCellScheduleDayCodesToDayCodesSet(input)).sort(util.sortNumbersAscendingFunction);
6891
+ return Array.from(expandDateCellScheduleDayCodesToDayCodesSet(input)).sort(util.sortNumbersAscendingFunction);
6904
6892
  }
6905
6893
  /**
6906
6894
  * Expands the input DateCellScheduleDayCodesInput to a Set of individual DateCellScheduleDayCode values (1-7), expanding shorthand codes like WEEKDAY and WEEKEND.
@@ -6938,7 +6926,7 @@ var DATE_CELL_SCHEDULE_ENCODED_WEEK_REGEX = /^[0-9]{0,9}$/;
6938
6926
  var dayCodes;
6939
6927
  switch(typeof input === "undefined" ? "undefined" : _type_of$2(input)){
6940
6928
  case 'string':
6941
- dayCodes = _to_consumable_array$2(new Set(input)).map(function(x) {
6929
+ dayCodes = Array.from(new Set(input)).map(function(x) {
6942
6930
  return Number(x);
6943
6931
  });
6944
6932
  break;
package/index.esm.js CHANGED
@@ -13,7 +13,7 @@ function _array_like_to_array$7(arr, len) {
13
13
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
14
14
  return arr2;
15
15
  }
16
- function _array_without_holes$5(arr) {
16
+ function _array_without_holes$4(arr) {
17
17
  if (Array.isArray(arr)) return _array_like_to_array$7(arr);
18
18
  }
19
19
  function _define_property$h(obj, key, value) {
@@ -29,10 +29,10 @@ function _define_property$h(obj, key, value) {
29
29
  }
30
30
  return obj;
31
31
  }
32
- function _iterable_to_array$5(iter) {
32
+ function _iterable_to_array$4(iter) {
33
33
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
34
34
  }
35
- function _non_iterable_spread$5() {
35
+ function _non_iterable_spread$4() {
36
36
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
37
37
  }
38
38
  function _object_spread$e(target) {
@@ -50,8 +50,8 @@ function _object_spread$e(target) {
50
50
  }
51
51
  return target;
52
52
  }
53
- function _to_consumable_array$5(arr) {
54
- return _array_without_holes$5(arr) || _iterable_to_array$5(arr) || _unsupported_iterable_to_array$7(arr) || _non_iterable_spread$5();
53
+ function _to_consumable_array$4(arr) {
54
+ return _array_without_holes$4(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$7(arr) || _non_iterable_spread$4();
55
55
  }
56
56
  function _unsupported_iterable_to_array$7(o, minLen) {
57
57
  if (!o) return;
@@ -605,7 +605,7 @@ function roundDateTo(date, roundToUnit) {
605
605
  * // names === ['Mon', 'Tue']
606
606
  * ```
607
607
  */ function readDaysOfWeekNames(values, readDate, nameFunction) {
608
- return _to_consumable_array$5(readDaysOfWeek(values, readDate)).sort(sortNumbersAscendingFunction).map(nameFunction);
608
+ return _to_consumable_array$4(readDaysOfWeek(values, readDate)).sort(sortNumbersAscendingFunction).map(nameFunction);
609
609
  }
610
610
  /**
611
611
  * Checks whether the given date falls exactly at midnight (00:00:00.000) in UTC.
@@ -4192,7 +4192,7 @@ function _array_like_to_array$6(arr, len) {
4192
4192
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
4193
4193
  return arr2;
4194
4194
  }
4195
- function _array_without_holes$4(arr) {
4195
+ function _array_without_holes$3(arr) {
4196
4196
  if (Array.isArray(arr)) return _array_like_to_array$6(arr);
4197
4197
  }
4198
4198
  function _define_property$c(obj, key, value) {
@@ -4208,10 +4208,10 @@ function _define_property$c(obj, key, value) {
4208
4208
  }
4209
4209
  return obj;
4210
4210
  }
4211
- function _iterable_to_array$4(iter) {
4211
+ function _iterable_to_array$3(iter) {
4212
4212
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
4213
4213
  }
4214
- function _non_iterable_spread$4() {
4214
+ function _non_iterable_spread$3() {
4215
4215
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4216
4216
  }
4217
4217
  function _object_spread$a(target) {
@@ -4248,8 +4248,8 @@ function _object_spread_props$8(target, source) {
4248
4248
  }
4249
4249
  return target;
4250
4250
  }
4251
- function _to_consumable_array$4(arr) {
4252
- return _array_without_holes$4(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$6(arr) || _non_iterable_spread$4();
4251
+ function _to_consumable_array$3(arr) {
4252
+ return _array_without_holes$3(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$6(arr) || _non_iterable_spread$3();
4253
4253
  }
4254
4254
  function _type_of$4(obj) {
4255
4255
  "@swc/helpers - typeof";
@@ -4805,7 +4805,7 @@ function _unsupported_iterable_to_array$6(o, minLen) {
4805
4805
  * @param input - cells or ranges to group
4806
4806
  * @returns a UniqueDateCellRangeGroup containing the sorted blocks with `i` at 0
4807
4807
  */ function groupUniqueDateCells(input) {
4808
- var blocks = sortDateCellRanges(_to_consumable_array$4(input));
4808
+ var blocks = sortDateCellRanges(_to_consumable_array$3(input));
4809
4809
  var i = 0;
4810
4810
  var to;
4811
4811
  if (blocks.length === 0) {
@@ -6207,9 +6207,6 @@ function _array_like_to_array$5(arr, len) {
6207
6207
  function _array_with_holes$2(arr) {
6208
6208
  if (Array.isArray(arr)) return arr;
6209
6209
  }
6210
- function _array_without_holes$3(arr) {
6211
- if (Array.isArray(arr)) return _array_like_to_array$5(arr);
6212
- }
6213
6210
  function _instanceof(left, right) {
6214
6211
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
6215
6212
  return !!right[Symbol.hasInstance](left);
@@ -6217,9 +6214,6 @@ function _instanceof(left, right) {
6217
6214
  return left instanceof right;
6218
6215
  }
6219
6216
  }
6220
- function _iterable_to_array$3(iter) {
6221
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
6222
- }
6223
6217
  function _iterable_to_array_limit$2(arr, i) {
6224
6218
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
6225
6219
  if (_i == null) return;
@@ -6247,15 +6241,9 @@ function _iterable_to_array_limit$2(arr, i) {
6247
6241
  function _non_iterable_rest$2() {
6248
6242
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
6249
6243
  }
6250
- function _non_iterable_spread$3() {
6251
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
6252
- }
6253
6244
  function _sliced_to_array$2(arr, i) {
6254
6245
  return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$5(arr, i) || _non_iterable_rest$2();
6255
6246
  }
6256
- function _to_consumable_array$3(arr) {
6257
- return _array_without_holes$3(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$5(arr) || _non_iterable_spread$3();
6258
- }
6259
6247
  function _unsupported_iterable_to_array$5(o, minLen) {
6260
6248
  if (!o) return;
6261
6249
  if (typeof o === "string") return _array_like_to_array$5(o, minLen);
@@ -6552,7 +6540,7 @@ function yearWeekCode(dateOrYear, inputWeek) {
6552
6540
  }
6553
6541
  return yearWeekCode;
6554
6542
  });
6555
- var groups = _to_consumable_array$3(map.entries()).map(function(param) {
6543
+ var groups = Array.from(map.entries()).map(function(param) {
6556
6544
  var _param = _sliced_to_array$2(param, 2), week = _param[0], _$items = _param[1];
6557
6545
  return {
6558
6546
  week: week !== null && week !== void 0 ? week : 0,
@@ -6751,7 +6739,7 @@ function _unsupported_iterable_to_array$4(o, minLen) {
6751
6739
  * @param input - schedule day codes to convert (WEEKDAY/WEEKEND shorthand codes are expanded)
6752
6740
  * @returns an EnabledDays object with boolean flags for each day
6753
6741
  */ function enabledDaysFromDateCellScheduleDayCodes(input) {
6754
- var days = expandDateCellScheduleDayCodesToDayOfWeekSet(_to_consumable_array$2(new Set(input)));
6742
+ var days = expandDateCellScheduleDayCodesToDayOfWeekSet(Array.from(new Set(input)));
6755
6743
  return enabledDaysFromDaysOfWeek(days);
6756
6744
  }
6757
6745
  /**
@@ -6899,7 +6887,7 @@ var DATE_CELL_SCHEDULE_ENCODED_WEEK_REGEX = /^[0-9]{0,9}$/;
6899
6887
  * @param input - day codes to expand
6900
6888
  * @returns sorted array of individual day codes (1-7 only, no shorthand)
6901
6889
  */ function expandDateCellScheduleDayCodes(input) {
6902
- return _to_consumable_array$2(expandDateCellScheduleDayCodesToDayCodesSet(input)).sort(sortNumbersAscendingFunction);
6890
+ return Array.from(expandDateCellScheduleDayCodesToDayCodesSet(input)).sort(sortNumbersAscendingFunction);
6903
6891
  }
6904
6892
  /**
6905
6893
  * Expands the input DateCellScheduleDayCodesInput to a Set of individual DateCellScheduleDayCode values (1-7), expanding shorthand codes like WEEKDAY and WEEKEND.
@@ -6937,7 +6925,7 @@ var DATE_CELL_SCHEDULE_ENCODED_WEEK_REGEX = /^[0-9]{0,9}$/;
6937
6925
  var dayCodes;
6938
6926
  switch(typeof input === "undefined" ? "undefined" : _type_of$2(input)){
6939
6927
  case 'string':
6940
- dayCodes = _to_consumable_array$2(new Set(input)).map(function(x) {
6928
+ dayCodes = Array.from(new Set(input)).map(function(x) {
6941
6929
  return Number(x);
6942
6930
  });
6943
6931
  break;
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@dereekb/date",
3
- "version": "13.5.0",
3
+ "version": "13.5.2",
4
4
  "peerDependencies": {
5
- "@dereekb/model": "13.5.0",
6
- "@dereekb/rxjs": "13.5.0",
7
- "@dereekb/util": "13.5.0",
5
+ "@dereekb/model": "13.5.2",
6
+ "@dereekb/rxjs": "13.5.2",
7
+ "@dereekb/util": "13.5.2",
8
8
  "@vvo/tzdb": "^6.0.0",
9
9
  "arktype": "^2.2.0",
10
10
  "date-fns": "^4.0.0",
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "dependencies": {},
16
16
  "devDependencies": {
17
- "@dereekb/rxjs": "13.5.0"
17
+ "@dereekb/rxjs": "13.5.2"
18
18
  },
19
19
  "exports": {
20
20
  "./package.json": "./package.json",