Skip to content

Commit

Permalink
refactor: make cli settings more clear
Browse files Browse the repository at this point in the history
  • Loading branch information
juanjoDiaz committed Feb 10, 2024
1 parent 156e83a commit c1a3419
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions packages/cli/src/json2csv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ const { readFile, writeFile } = fsPromises;

type InputOptions = { ndjson: boolean; eol: string };
type OutputOptions = TablePrinterOptions & { pretty: boolean };
type FormattersOptions = {
excelStrings: boolean;
quote: string;
escapedQuote: string;
};
type TransformsOptions = {
flattenObjects: boolean;
flattenArrays: boolean;
flattenSeparator: string;
} & { unwind: true | string; unwindBlank: boolean };

type Options = {
input: string;
Expand All @@ -46,11 +56,9 @@ type Options = {
Omit<ParserOptions<unknown, unknown>, 'fields' | 'withBOM'> & {
fields?: Array<string> | string;
withBom: boolean;
} & StreamParserOptions & {
flattenObjects: boolean;
flattenArrays: boolean;
flattenSeparator: string;
} & { unwind: true | string; unwindBlank: boolean };
} & StreamParserOptions &
FormattersOptions &
TransformsOptions;

const program = new Command();
program
Expand Down

0 comments on commit c1a3419

Please sign in to comment.