const hasDuplicates = map.size > new Set(Array.from(map, n => n[1].id)).size;
const duplicates = Array
.from([...map].reduce((acc, [ , { id } ]) => acc.set(id, acc.has(id)), new Map))
.reduce((acc, n) => (n[1] && acc.push(n[0]), acc), []);
const count = Array
.from(map.values())
.reduce((acc, { id }) => acc.set(id, -~acc.get(id)), new Map);