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

Function getDataSize

src/status/utils.ts:34–58  ·  view source on GitHub ↗
(
  sheetData: SheetState[],
  sheetDefinitions: SheetDefinition[],
  enumLabelDict: EnumLabelDict,
  csvDownloadMode: CsvDownloadMode
)

Source from the content-addressed store, hash-verified

32}
33
34export const getDataSize = (
35 sheetData: SheetState[],
36 sheetDefinitions: SheetDefinition[],
37 enumLabelDict: EnumLabelDict,
38 csvDownloadMode: CsvDownloadMode
39) => {
40 if (!sheetData.length) return 0;
41
42 return sheetData.reduce((totalSize, sheet) => {
43 const sheetDefinition = sheetDefinitions.find(
44 (s) => s.id === sheet.sheetId
45 );
46 if (!sheetDefinition) return totalSize;
47
48 return (
49 totalSize +
50 generateCsvContent(
51 sheetDefinition,
52 sheet.rows,
53 enumLabelDict,
54 csvDownloadMode
55 ).size
56 );
57 }, 0);
58};

Callers 1

SummaryInfoFunction · 0.90

Calls 1

generateCsvContentFunction · 0.90

Tested by

no test coverage detected