Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
yhabib committed Nov 22, 2024
1 parent 460f594 commit 7574962
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frontend/src/lib/utils/export-to-csv.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const convertToCsv = <T>({
metadata = [],
}: CsvBaseConfig<T>) => {
if (headers.length === 0) return "";

const PAD_LEFT_WHEN_METADATA_PRESENT = 2;
const csvRows: string[] = [];
let padLeft = 0;
Expand All @@ -68,7 +68,9 @@ export const convertToCsv = <T>({
csvRows.push(metadataRow);

// Add an empty row to separate metadata from data
const emptyRow = Array(headers.length + metadata.length).fill("").join(",");
const emptyRow = Array(headers.length + metadata.length)
.fill("")
.join(",");
csvRows.push(emptyRow);

padLeft = PAD_LEFT_WHEN_METADATA_PRESENT;
Expand Down

0 comments on commit 7574962

Please sign in to comment.