{"version":3,"file":"union.mjs","names":[],"sources":["../../src/array/union.ts"],"sourcesContent":["/**\n * Creates an array of unique values that are in any of the given arrays\n * @param arrays The arrays to process\n * @returns A new array of unique values from all arrays\n * @example\n * union([1, 2, 3], [2, 3, 4]); // [1, 2, 3, 4]\n * union([1, 2], [3, 4], [2, 5]); // [1, 2, 3, 4, 5]\n */\nexport function union<T>(...arrays: T[][]): T[] {\n  const result: T[] = [];\n  const seen = new Set<T>();\n\n  for (const array of arrays) {\n    if (Array.isArray(array)) {\n      for (const item of array) {\n        if (!seen.has(item)) {\n          seen.add(item);\n          result.push(item);\n        }\n      }\n    }\n  }\n\n  return result;\n}\n"],"mappings":";;;;;;;;;AAQA,SAAgB,MAAS,GAAG,QAAoB;CAC9C,MAAM,SAAc,CAAC;CACrB,MAAM,uBAAO,IAAI,IAAO;CAExB,KAAK,MAAM,SAAS,QAClB,IAAI,MAAM,QAAQ,KAAK,GAChB;OAAA,MAAM,QAAQ,OACjB,IAAI,CAAC,KAAK,IAAI,IAAI,GAAG;GACnB,KAAK,IAAI,IAAI;GACb,OAAO,KAAK,IAAI;EAClB;;CAKN,OAAO;AACT"}