import { DMMF } from '@prisma/generator-helper' ; export const removeDublicates = ( arr , key ) : { name : string ; kind : DMMF . FieldKind ; } [ ] => arr . reduce ( ( acc , current ) => { const x = acc . find ( ( item ) => item [ key ] === current [ key ] ) ; if ( ! x ) { return acc . concat ( [ current ] ) ; } else { return acc ; } } , [ ] ) ;