DieselDepot-APP/node_modules/es-toolkit/dist/fp/array/uniq.d.mts
SJCoetz def597c157 chore: add generated build artifacts and node module type files
add all Next.js build outputs and third-party dependency type declaration files
2026-07-20 01:18:42 +02:00

21 lines
No EOL
713 B
TypeScript

//#region src/fp/array/uniq.d.ts
/**
* Creates a function that removes duplicate values from an array, preserving
* the order of first occurrence. Equality follows SameValueZero, matching
* Set semantics. Use it with {@link pipe}.
*
* The returned function is lazy-capable inside {@link pipe}. It keeps a Set of
* values already emitted during each pipeline run.
*
* @template T - The type of elements in the array.
* @returns A function that maps a readonly array to a duplicate-free array.
*
* @example
* import { pipe, uniq } from 'es-toolkit/fp';
*
* pipe([1, 2, 2, 3, 3, 3], uniq());
* // => [1, 2, 3]
*/
declare function uniq<T>(): (array: readonly T[]) => T[];
//#endregion
export { uniq };