MCPcopy Create free account
hub / github.com/HelloCSV/HelloCSV / removeMappingDuplicates

Function removeMappingDuplicates

src/mapper/utils.ts:16–26  ·  view source on GitHub ↗
(mappings: ColumnMapping[])

Source from the content-addressed store, hash-verified

14import { allowUserToMapColumn } from '.';
15
16function removeMappingDuplicates(mappings: ColumnMapping[]): ColumnMapping[] {
17 const uniqueMap = new Map<string, ColumnMapping>();
18
19 mappings.forEach((entry) => {
20 if (!uniqueMap.has(entry.csvColumnName)) {
21 uniqueMap.set(entry.csvColumnName, entry);
22 }
23 });
24
25 return Array.from(uniqueMap.values());
26}
27
28function buildSheetSuggestedHeaderMappings(
29 sheet: SheetDefinition,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected