type Entries = Array < { type : string ; id : string ; } > ; export const getNonUniqueEntries = ( objects ) => { const idCountMap = objects . reduce ( ( acc , { type , id } ) => { const key = `${ type }:${ id }` ; const val = acc . get ( key ) ?? 0 ; return acc . set ( key , val + 1 ) ; } , new Map < string , number > ( ) ) ; const nonUniqueEntries = [ ] ; idCountMap . forEach ( ( value , key ) => { if ( value >= 2 ) { nonUniqueEntries . push ( key ) ; } } ) ; return nonUniqueEntries ; } ;