0
0
mirror of https://github.com/renovatebot/renovate.git synced 2024-12-22 05:28:35 +00:00
renovatebot_renovate/lib/util/uniq.ts
2023-11-07 15:50:29 +00:00

7 lines
183 B
TypeScript

export function uniq<T = unknown>(
array: T[],
eql = (x: T, y: T): boolean => x === y,
): T[] {
return array.filter((x, idx, arr) => arr.findIndex((y) => eql(x, y)) === idx);
}