{"version":3,"file":"uniqBy.cjs","names":[],"sources":["../../src/array/uniqBy.ts"],"sourcesContent":["/**\n * Removes duplicate values from an array based on a predicate function\n * @param array The array to deduplicate\n * @param iteratee The function to compute the value to check for uniqueness\n * @returns A new array with duplicate values removed\n * @example\n * uniqBy([{ id: 1, name: 'a' }, { id: 2, name: 'b' }, { id: 1, name: 'c' }], (item) => item.id);\n * // [{ id: 1, name: 'a' }, { id: 2, name: 'b' }]\n */\nexport function uniqBy<T, K = unknown>(array: T[], iteratee: (item: T) => K): T[] {\n  if (!Array.isArray(array)) {\n    return [];\n  }\n\n  const seen = new Set<K>();\n  const result: T[] = [];\n\n  for (const item of array) {\n    const computed = iteratee(item);\n    if (!seen.has(computed)) {\n      seen.add(computed);\n      result.push(item);\n    }\n  }\n\n  return result;\n}\n"],"mappings":";;;;;;;;;;;AASA,SAAgB,OAAuB,OAAY,UAA+B;CAChF,IAAI,CAAC,MAAM,QAAQ,KAAK,GACtB,OAAO,CAAC;CAGV,MAAM,uBAAO,IAAI,IAAO;CACxB,MAAM,SAAc,CAAC;CAErB,KAAK,MAAM,QAAQ,OAAO;EACxB,MAAM,WAAW,SAAS,IAAI;EAC9B,IAAI,CAAC,KAAK,IAAI,QAAQ,GAAG;GACvB,KAAK,IAAI,QAAQ;GACjB,OAAO,KAAK,IAAI;EAClB;CACF;CAEA,OAAO;AACT"}