fix: remove quote when header flag is set to true

This commit is contained in:
Chesterkxng
2025-04-05 13:34:35 +02:00
parent d4d63b181c
commit b96c12bbd2

View File

@@ -57,6 +57,9 @@ export function main(input: string, options: InitialValuesType): string {
if (options.headerRow) {
const headerRow = getCsvHeaders(input, options.csvSeparator);
headerRow.forEach((header, headerIndex) => {
headerRow[headerIndex] = unquoteIfQuoted(header, options.quoteCharacter);
});
const result: Record<string, string>[] = rows.slice(1).map((row) => {
const entry: Record<string, string> = {};