MultiLoader-Template/node_modules/es-toolkit/dist/array/uniq.d.mts
3944Realms 768f38fc97 feat: 可使用的构建模板
修改了脚本,使其可以推给Maven仓库
2026-05-03 13:02:19 +08:00

19 lines
589 B
TypeScript

/**
* Creates a duplicate-free version of an array.
*
* This function takes an array and returns a new array containing only the unique values
* from the original array, preserving the order of first occurrence.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The array to process.
* @returns {T[]} A new array with only unique values from the original array.
*
* @example
* const array = [1, 2, 2, 3, 4, 4, 5];
* const result = uniq(array);
* // result will be [1, 2, 3, 4, 5]
*/
declare function uniq<T>(arr: readonly T[]): T[];
export { uniq };