@oscarpalmer/atoms 0.196.0 → 0.196.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.d.mts CHANGED
@@ -8040,18 +8040,18 @@ declare function median(array: number[]): number;
8040
8040
  * @param items List of items
8041
8041
  * @param callback Callback to get an item's value
8042
8042
  * @param first Return only the first item with the minimum value
8043
- * @returns Items with the minimum value
8043
+ * @returns First item with the minimum value, or `undefined` if no minimum can be found
8044
8044
  */
8045
- declare function min<Item>(items: Item[], callback: (item: Item, index: number, array: Item[]) => number, first: true): Item[];
8045
+ declare function min<Item>(items: Item[], callback: (item: Item, index: number, array: Item[]) => number, first: true): Item | undefined;
8046
8046
  /**
8047
8047
  * Get the minimum value from a list of items
8048
8048
  *
8049
8049
  * @param items List of items
8050
8050
  * @param key Key to use for value
8051
8051
  * @param first Return only the first item with the minimum value
8052
- * @returns Items with the minimum value
8052
+ * @returns First item with the minimum value, or `undefined` if no minimum can be found
8053
8053
  */
8054
- declare function min<Item extends PlainObject>(items: Item[], key: keyof NumericalValues<Item>, first: true): Item[];
8054
+ declare function min<Item extends PlainObject>(items: Item[], key: keyof NumericalValues<Item>, first: true): Item | undefined;
8055
8055
  /**
8056
8056
  * Get the minimum value from a list of items
8057
8057
  *
package/dist/math.d.mts CHANGED
@@ -95,18 +95,18 @@ declare function median(array: number[]): number;
95
95
  * @param items List of items
96
96
  * @param callback Callback to get an item's value
97
97
  * @param first Return only the first item with the minimum value
98
- * @returns Items with the minimum value
98
+ * @returns First item with the minimum value, or `undefined` if no minimum can be found
99
99
  */
100
- declare function min<Item>(items: Item[], callback: (item: Item, index: number, array: Item[]) => number, first: true): Item[];
100
+ declare function min<Item>(items: Item[], callback: (item: Item, index: number, array: Item[]) => number, first: true): Item | undefined;
101
101
  /**
102
102
  * Get the minimum value from a list of items
103
103
  *
104
104
  * @param items List of items
105
105
  * @param key Key to use for value
106
106
  * @param first Return only the first item with the minimum value
107
- * @returns Items with the minimum value
107
+ * @returns First item with the minimum value, or `undefined` if no minimum can be found
108
108
  */
109
- declare function min<Item extends PlainObject>(items: Item[], key: keyof NumericalValues<Item>, first: true): Item[];
109
+ declare function min<Item extends PlainObject>(items: Item[], key: keyof NumericalValues<Item>, first: true): Item | undefined;
110
110
  /**
111
111
  * Get the minimum value from a list of items
112
112
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oscarpalmer/atoms",
3
- "version": "0.196.0",
3
+ "version": "0.196.1",
4
4
  "description": "Atomic utilities for making your JavaScript better.",
5
5
  "keywords": [
6
6
  "array",