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

Function downloadSheetAsCsv

src/utils/index.ts:118–136  ·  view source on GitHub ↗
(
  sheetDefinition: SheetDefinition,
  data: SheetRow[],
  enumLabelDict: EnumLabelDict,
  csvDownloadMode: CsvDownloadMode
)

Source from the content-addressed store, hash-verified

116}
117
118export function downloadSheetAsCsv(
119 sheetDefinition: SheetDefinition,
120 data: SheetRow[],
121 enumLabelDict: EnumLabelDict,
122 csvDownloadMode: CsvDownloadMode
123) {
124 const blob = generateCsvContent(
125 sheetDefinition,
126 data,
127 enumLabelDict,
128 csvDownloadMode
129 );
130 const url = URL.createObjectURL(blob);
131 const a = document.createElement('a');
132 a.href = url;
133 a.download = `${sheetDefinition.label}.csv`;
134 a.click();
135 URL.revokeObjectURL(url);
136}
137
138export function getLabelDict(
139 columnDefinition: SheetColumnReferenceDefinition,

Callers 2

SheetDataEditorActionsFunction · 0.90
downloadAllSheetsAsCsvFunction · 0.90

Calls 1

generateCsvContentFunction · 0.85

Tested by

no test coverage detected