Migrate to a monorepo structure (#2909)
This commit is contained in:
@ -0,0 +1,15 @@
|
||||
import uniqBy from 'lodash/uniqBy';
|
||||
|
||||
import {
|
||||
MatchColumnsStepProps,
|
||||
MatchedOptions,
|
||||
} from '@/spreadsheet-import/steps/components/MatchColumnsStep/MatchColumnsStep';
|
||||
|
||||
export const uniqueEntries = <T extends string>(
|
||||
data: MatchColumnsStepProps<T>['data'],
|
||||
index: number,
|
||||
): Partial<MatchedOptions<T>>[] =>
|
||||
uniqBy(
|
||||
data.map((row) => ({ entry: row[index] })),
|
||||
'entry',
|
||||
).filter(({ entry }) => !!entry);
|
||||
Reference in New Issue
Block a user