uniqBy (Functional Programming) es-toolkit
Creates a function that removes duplicates by a mapped key. Use it with pipe.
Info
Usage
uniqBy keeps the first value for each key returned by mapper. It preserves the order of first occurrence and is lazy-capable inside pipe.
Parameters
mapper(item: T, index: number) => Urequired
The function that returns the key used for uniqueness.
Returns
A function that maps a readonly T[] to a duplicate-free array by key.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.