Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

312 B
Raw Blame
export function intersectById<T extends { id: string }>(
  lists: readonly (readonly T[])[],
): T[] {
  const [first, ...rest] = lists;
  if (!first) return [];
  const others = rest.map((list) => new Set(list.map((item) => item.id)));
  return first.filter((item) => others.every((ids) => ids.has(item.id)));
}