import uniqBy from 'lodash.uniqby'; import { MatchColumnsStepProps } from '@/spreadsheet-import/steps/components/MatchColumnsStep/MatchColumnsStep'; import { SpreadsheetMatchedOptions } from '@/spreadsheet-import/types/SpreadsheetMatchedOptions'; export const uniqueEntries = ( data: MatchColumnsStepProps['data'], index: number, ): Partial[] => uniqBy( data.map((row) => ({ entry: row[index] })), 'entry', ).filter(({ entry }) => !!entry);