es-toolkit 1.16.0-dev.481 → 1.16.0-dev.483

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.
@@ -13,6 +13,16 @@
13
13
  * uniqBy([1.2, 1.5, 2.1, 3.2, 5.7, 5.3, 7.19], Math.floor);
14
14
  * // [1.2, 2.1, 3.2, 5.7, 7.19]
15
15
  * ```
16
+ *
17
+ * @example
18
+ * const array = [
19
+ * { category: 'fruit', name: 'apple' },
20
+ * { category: 'fruit', name: 'banana' },
21
+ * { category: 'vegetable', name: 'carrot' },
22
+ * ];
23
+ * uniqBy(array, item => item.category).length
24
+ * // 2
25
+ * ```
16
26
  */
17
27
  declare function uniqBy<T, U>(arr: readonly T[], mapper: (item: T) => U): T[];
18
28
 
@@ -13,6 +13,16 @@
13
13
  * uniqBy([1.2, 1.5, 2.1, 3.2, 5.7, 5.3, 7.19], Math.floor);
14
14
  * // [1.2, 2.1, 3.2, 5.7, 7.19]
15
15
  * ```
16
+ *
17
+ * @example
18
+ * const array = [
19
+ * { category: 'fruit', name: 'apple' },
20
+ * { category: 'fruit', name: 'banana' },
21
+ * { category: 'vegetable', name: 'carrot' },
22
+ * ];
23
+ * uniqBy(array, item => item.category).length
24
+ * // 2
25
+ * ```
16
26
  */
17
27
  declare function uniqBy<T, U>(arr: readonly T[], mapper: (item: T) => U): T[];
18
28