fix: skip commas between quotes

This commit is contained in:
Chesterkxng
2025-04-07 02:41:20 +02:00
parent adf72108c6
commit cfc59f3ae0
2 changed files with 73 additions and 7 deletions

View File

@@ -50,7 +50,8 @@ export function main(input: string, options: InitialValuesType): string {
true,
options.commentCharacter,
options.emptyLines,
options.csvSeparator
options.csvSeparator,
options.quoteCharacter
);
rows.forEach((row) => {
@@ -60,7 +61,12 @@ export function main(input: string, options: InitialValuesType): string {
});
if (options.headerRow) {
const headerRow = getCsvHeaders(input, options.csvSeparator);
const headerRow = getCsvHeaders(
input,
options.csvSeparator,
options.quoteCharacter,
options.commentCharacter
);
headerRow.forEach((header, headerIndex) => {
headerRow[headerIndex] = unquoteIfQuoted(header, options.quoteCharacter);
});