util: handle quote opt with the same api for input list

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2023-02-18 01:53:59 +01:00
parent cb9121174a
commit f288f4f7ea
2 changed files with 9 additions and 3 deletions

View File

@@ -19,7 +19,7 @@ import {parse} from 'csv-parse/sync';
export interface InputListOpts {
ignoreComma?: boolean;
escapeQuotes?: boolean;
quote?: string | boolean | Buffer | null;
}
export class Util {
@@ -37,7 +37,7 @@ export class Util {
comment: '#',
relaxColumnCount: true,
skipEmptyLines: true,
quote: opts?.escapeQuotes ?? `"`
quote: opts?.quote
});
for (const record of records as Array<string[]>) {