mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-09-19 05:59:34 +02:00
fix: remove quote when header flag is set to true
This commit is contained in:
@@ -57,6 +57,9 @@ export function main(input: string, options: InitialValuesType): string {
|
|||||||
|
|
||||||
if (options.headerRow) {
|
if (options.headerRow) {
|
||||||
const headerRow = getCsvHeaders(input, options.csvSeparator);
|
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 result: Record<string, string>[] = rows.slice(1).map((row) => {
|
||||||
const entry: Record<string, string> = {};
|
const entry: Record<string, string> = {};
|
||||||
|
Reference in New Issue
Block a user