es-toolkit 1.20.0-dev.643 → 1.20.0-dev.646

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.
@@ -9,6 +9,14 @@
9
9
  * @example
10
10
  * maxBy([{ a: 1 }, { a: 2 }, { a: 3 }], x => x.a); // Returns: { a: 3 }
11
11
  * maxBy([], x => x.a); // Returns: undefined
12
+ * maxBy(
13
+ * [
14
+ * { name: 'john', age: 30 },
15
+ * { name: 'jane', age: 28 },
16
+ * { name: 'joe', age: 26 },
17
+ * ],
18
+ * x => x.age
19
+ * ); // Returns: { name: 'john', age: 30 }
12
20
  */
13
21
  declare function maxBy<T>(items: readonly [T, ...T[]], getValue: (element: T) => number): T;
14
22
  /**
@@ -22,6 +30,14 @@ declare function maxBy<T>(items: readonly [T, ...T[]], getValue: (element: T) =>
22
30
  * @example
23
31
  * maxBy([{ a: 1 }, { a: 2 }, { a: 3 }], x => x.a); // Returns: { a: 3 }
24
32
  * maxBy([], x => x.a); // Returns: undefined
33
+ * maxBy(
34
+ * [
35
+ * { name: 'john', age: 30 },
36
+ * { name: 'jane', age: 28 },
37
+ * { name: 'joe', age: 26 },
38
+ * ],
39
+ * x => x.age
40
+ * ); // Returns: { name: 'john', age: 30 }
25
41
  */
26
42
  declare function maxBy<T>(items: readonly T[], getValue: (element: T) => number): T | undefined;
27
43
 
@@ -9,6 +9,14 @@
9
9
  * @example
10
10
  * maxBy([{ a: 1 }, { a: 2 }, { a: 3 }], x => x.a); // Returns: { a: 3 }
11
11
  * maxBy([], x => x.a); // Returns: undefined
12
+ * maxBy(
13
+ * [
14
+ * { name: 'john', age: 30 },
15
+ * { name: 'jane', age: 28 },
16
+ * { name: 'joe', age: 26 },
17
+ * ],
18
+ * x => x.age
19
+ * ); // Returns: { name: 'john', age: 30 }
12
20
  */
13
21
  declare function maxBy<T>(items: readonly [T, ...T[]], getValue: (element: T) => number): T;
14
22
  /**
@@ -22,6 +30,14 @@ declare function maxBy<T>(items: readonly [T, ...T[]], getValue: (element: T) =>
22
30
  * @example
23
31
  * maxBy([{ a: 1 }, { a: 2 }, { a: 3 }], x => x.a); // Returns: { a: 3 }
24
32
  * maxBy([], x => x.a); // Returns: undefined
33
+ * maxBy(
34
+ * [
35
+ * { name: 'john', age: 30 },
36
+ * { name: 'jane', age: 28 },
37
+ * { name: 'joe', age: 26 },
38
+ * ],
39
+ * x => x.age
40
+ * ); // Returns: { name: 'john', age: 30 }
25
41
  */
26
42
  declare function maxBy<T>(items: readonly T[], getValue: (element: T) => number): T | undefined;
27
43
 
@@ -9,6 +9,14 @@
9
9
  * @example
10
10
  * minBy([{ a: 1 }, { a: 2 }, { a: 3 }], x => x.a); // Returns: { a: 1 }
11
11
  * minBy([], x => x.a); // Returns: undefined
12
+ * minBy(
13
+ * [
14
+ * { name: 'john', age: 30 },
15
+ * { name: 'jane', age: 28 },
16
+ * { name: 'joe', age: 26 },
17
+ * ],
18
+ * x => x.age
19
+ * ); // Returns: { name: 'joe', age: 26 }
12
20
  */
13
21
  declare function minBy<T>(items: readonly [T, ...T[]], getValue: (element: T) => number): T;
14
22
  /**
@@ -22,6 +30,14 @@ declare function minBy<T>(items: readonly [T, ...T[]], getValue: (element: T) =>
22
30
  * @example
23
31
  * minBy([{ a: 1 }, { a: 2 }, { a: 3 }], x => x.a); // Returns: { a: 1 }
24
32
  * minBy([], x => x.a); // Returns: undefined
33
+ * minBy(
34
+ * [
35
+ * { name: 'john', age: 30 },
36
+ * { name: 'jane', age: 28 },
37
+ * { name: 'joe', age: 26 },
38
+ * ],
39
+ * x => x.age
40
+ * ); // Returns: { name: 'joe', age: 26 }
25
41
  */
26
42
  declare function minBy<T>(items: readonly T[], getValue: (element: T) => number): T | undefined;
27
43
 
@@ -9,6 +9,14 @@
9
9
  * @example
10
10
  * minBy([{ a: 1 }, { a: 2 }, { a: 3 }], x => x.a); // Returns: { a: 1 }
11
11
  * minBy([], x => x.a); // Returns: undefined
12
+ * minBy(
13
+ * [
14
+ * { name: 'john', age: 30 },
15
+ * { name: 'jane', age: 28 },
16
+ * { name: 'joe', age: 26 },
17
+ * ],
18
+ * x => x.age
19
+ * ); // Returns: { name: 'joe', age: 26 }
12
20
  */
13
21
  declare function minBy<T>(items: readonly [T, ...T[]], getValue: (element: T) => number): T;
14
22
  /**
@@ -22,6 +30,14 @@ declare function minBy<T>(items: readonly [T, ...T[]], getValue: (element: T) =>
22
30
  * @example
23
31
  * minBy([{ a: 1 }, { a: 2 }, { a: 3 }], x => x.a); // Returns: { a: 1 }
24
32
  * minBy([], x => x.a); // Returns: undefined
33
+ * minBy(
34
+ * [
35
+ * { name: 'john', age: 30 },
36
+ * { name: 'jane', age: 28 },
37
+ * { name: 'joe', age: 26 },
38
+ * ],
39
+ * x => x.age
40
+ * ); // Returns: { name: 'joe', age: 26 }
25
41
  */
26
42
  declare function minBy<T>(items: readonly T[], getValue: (element: T) => number): T | undefined;
27
43