@oscarpalmer/atoms 0.196.1 → 0.198.0

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.
@@ -7,5 +7,6 @@ function filter(array, ...parameters) {
7
7
  return findValues("all", array, parameters).matched;
8
8
  }
9
9
  filter.remove = exclude;
10
+ Object.defineProperty(filter, "remove", { value: exclude });
10
11
  //#endregion
11
12
  export { exclude, filter };
@@ -3,9 +3,10 @@ import { FIND_VALUE_ITEM, findValue } from "../internal/array/find.mjs";
3
3
  function find(array, ...parameters) {
4
4
  return findValue(FIND_VALUE_ITEM, array, parameters, false);
5
5
  }
6
- find.last = findLast;
7
6
  function findLast(array, ...parameters) {
8
7
  return findValue(FIND_VALUE_ITEM, array, parameters, true);
9
8
  }
9
+ find.last = findLast;
10
+ Object.defineProperty(find, "last", { value: findLast });
10
11
  //#endregion
11
12
  export { find, findLast };
@@ -3,9 +3,10 @@ import { findAbsoluteValueOrDefault } from "../internal/array/find.mjs";
3
3
  function first(array, ...parameters) {
4
4
  return findAbsoluteValueOrDefault(array, parameters, void 0, false, false);
5
5
  }
6
- first.default = firstOrDefault;
7
6
  function firstOrDefault(array, defaultValue, ...parameters) {
8
7
  return findAbsoluteValueOrDefault(array, parameters, defaultValue, true, false);
9
8
  }
9
+ first.default = firstOrDefault;
10
+ Object.defineProperty(first, "default", { value: firstOrDefault });
10
11
  //#endregion
11
12
  export { first, firstOrDefault };
@@ -3,9 +3,10 @@ import { groupValues } from "../internal/array/group.mjs";
3
3
  function groupBy(array, first, second) {
4
4
  return groupValues(array, first, second, false);
5
5
  }
6
- groupBy.arrays = groupArraysBy;
7
6
  function groupArraysBy(array, first, second) {
8
7
  return groupValues(array, first, second, true);
9
8
  }
9
+ groupBy.arrays = groupArraysBy;
10
+ Object.defineProperty(groupBy, "arrays", { value: groupArraysBy });
10
11
  //#endregion
11
12
  export { groupArraysBy, groupBy };
@@ -3,9 +3,10 @@ import { findAbsoluteValueOrDefault } from "../internal/array/find.mjs";
3
3
  function last(array, ...parameters) {
4
4
  return findAbsoluteValueOrDefault(array, parameters, void 0, false, true);
5
5
  }
6
- last.default = lastOrDefault;
7
6
  function lastOrDefault(array, defaultValue, ...parameters) {
8
7
  return findAbsoluteValueOrDefault(array, parameters, defaultValue, true, true);
9
8
  }
9
+ last.default = lastOrDefault;
10
+ Object.defineProperty(last, "default", { value: lastOrDefault });
10
11
  //#endregion
11
12
  export { last, lastOrDefault };
@@ -23,8 +23,6 @@ function move(array, from, to, key) {
23
23
  else array.splice(next, 0, ...firstArray);
24
24
  return array;
25
25
  }
26
- move.indices = moveIndices;
27
- move.toIndex = moveToIndex;
28
26
  /**
29
27
  * Move an item from one index to another within an array
30
28
  *
@@ -72,5 +70,11 @@ function moveToIndex(array, value, index, key) {
72
70
  else array.splice(next, 0, ...values);
73
71
  return array;
74
72
  }
73
+ move.indices = moveIndices;
74
+ move.toIndex = moveToIndex;
75
+ Object.defineProperties(move, {
76
+ indices: { value: moveIndices },
77
+ toIndex: { value: moveToIndex }
78
+ });
75
79
  //#endregion
76
80
  export { move, moveIndices, moveToIndex };
@@ -126,9 +126,6 @@ function sortArray(array, sorters) {
126
126
  const { length } = sorters;
127
127
  return array.length > 1 ? array.sort((first, second) => getComparisonValue(first, second, sorters, length)) : array;
128
128
  }
129
- sort.getIndex = getSortedIndex;
130
- sort.initialize = initializeSorter;
131
- sort.is = isSorted;
132
129
  const SORT_PEEK_PERCENTAGE = 10;
133
130
  const SORT_THRESHOLD = 100;
134
131
  const SORT_DIRECTION_ASCENDING = "ascending";
@@ -137,5 +134,13 @@ const modifiers = {
137
134
  [SORT_DIRECTION_ASCENDING]: 1,
138
135
  [SORT_DIRECTION_DESCENDING]: -1
139
136
  };
137
+ sort.getIndex = getSortedIndex;
138
+ sort.initialize = initializeSorter;
139
+ sort.is = isSorted;
140
+ Object.defineProperties(sort, {
141
+ getIndex: { value: getSortedIndex },
142
+ initialize: { value: initializeSorter },
143
+ is: { value: isSorted }
144
+ });
140
145
  //#endregion
141
146
  export { SORT_DIRECTION_ASCENDING, SORT_DIRECTION_DESCENDING, getSortedIndex, initializeSorter, isSorted, sort };
@@ -9,7 +9,6 @@ function swap(array, first, second, third) {
9
9
  if (Array.isArray(first) && Array.isArray(second)) return swapArrays(array, first, second, third);
10
10
  return swapValues(array, first, second, third);
11
11
  }
12
- swap.indices = swapIndices;
13
12
  function swapArrays(array, from, to, key) {
14
13
  if (from.length === 0 || to.length === 0) return array;
15
14
  if (from.length === 1 && to.length === 1) return swapValues(array, from[0], to[0], key);
@@ -58,5 +57,7 @@ function swapValues(array, from, to, key) {
58
57
  if (first === second || first === -1 || second === -1) return array;
59
58
  return swapIndices(array, first, second);
60
59
  }
60
+ swap.indices = swapIndices;
61
+ Object.defineProperty(swap, "indices", { value: swapIndices });
61
62
  //#endregion
62
63
  export { swap };
@@ -20,9 +20,10 @@ function getMapValues(array, first, second, arrays) {
20
20
  function toMap(array, first, second) {
21
21
  return getMapValues(array, first, second, false);
22
22
  }
23
- toMap.arrays = toMapArrays;
24
23
  function toMapArrays(array, first, second) {
25
24
  return getMapValues(array, first, second, true);
26
25
  }
26
+ toMap.arrays = toMapArrays;
27
+ Object.defineProperty(toMap, "arrays", { value: toMapArrays });
27
28
  //#endregion
28
29
  export { toMap, toMapArrays };
@@ -3,9 +3,10 @@ import { groupValues } from "../internal/array/group.mjs";
3
3
  function toRecord(array, first, second) {
4
4
  return groupValues(array, first, second, false);
5
5
  }
6
- toRecord.arrays = toRecordArrays;
7
6
  function toRecordArrays(array, first, second) {
8
7
  return groupValues(array, first, second, true);
9
8
  }
9
+ toRecord.arrays = toRecordArrays;
10
+ Object.defineProperty(toRecord, "arrays", { value: toRecordArrays });
10
11
  //#endregion
11
12
  export { toRecord, toRecordArrays };