From 1ce689542dad8aac5afadaa9321b10fcb750a6e8 Mon Sep 17 00:00:00 2001 From: Philipp Staender Date: Mon, 22 Apr 2024 07:59:38 +0200 Subject: [PATCH] code formatting --- .prettierrc.yml | 2 -- bin/csv2md | 2 +- src/cli.ts | 9 +++------ src/csv2md.ts | 2 +- test/test.ts | 4 ++-- 5 files changed, 7 insertions(+), 12 deletions(-) delete mode 100644 .prettierrc.yml diff --git a/.prettierrc.yml b/.prettierrc.yml deleted file mode 100644 index 4a5d91a..0000000 --- a/.prettierrc.yml +++ /dev/null @@ -1,2 +0,0 @@ -singleQuote: false -semi: true diff --git a/bin/csv2md b/bin/csv2md index 958937f..b4ca7ba 100755 --- a/bin/csv2md +++ b/bin/csv2md @@ -1,2 +1,2 @@ #!/usr/bin/env node -require('../src/cli') +require("../src/cli"); diff --git a/src/cli.ts b/src/cli.ts index 1b9b4fa..845358e 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -16,10 +16,7 @@ Usage: $0 [options] ` `Converts csv to pretty markdown table` ) .example(`cat data.csv | $0 > output.md`, `Converts larger data`) - .example( - `$0 -d=";" < ~/data.csv`, - `Using another csv delimiter than ,` - ) + .example(`$0 -d=";" < ~/data.csv`, `Using another csv delimiter than ,`) .describe( "pretty", "pretty output, i.e. optimized column width and not inline-style" @@ -73,7 +70,7 @@ const options: Options = { csvComment: argv.csvComment as string, csvDelimiter: argv.csvDelimiter as string, csvQuote: argv.csvQuote as string, - csvEscape: argv.csvEscape as string, + csvEscape: argv.csvEscape as string }; const csv2md = new Csv2md(options); @@ -85,7 +82,7 @@ const parser = parse({ comment: options.csvComment as string, delimiter: options.csvDelimiter, quote: options.csvQuote, - escape: options.csvEscape, + escape: options.csvEscape }); if (processAsStream) { diff --git a/src/csv2md.ts b/src/csv2md.ts index 802be6e..d2e0823 100644 --- a/src/csv2md.ts +++ b/src/csv2md.ts @@ -201,7 +201,7 @@ export class Csv2md implements Options { comment: this.csvComment, delimiter: this.csvDelimiter, quote: this.csvQuote, - escape: this.csvEscape, + escape: this.csvEscape }); return this.rowsToString(data); } diff --git a/test/test.ts b/test/test.ts index f8a0dd6..29f851e 100644 --- a/test/test.ts +++ b/test/test.ts @@ -8,7 +8,7 @@ const csvOptions = { comment: "#", delimiter: undefined, quote: undefined, - escape: undefined, + escape: undefined }; const options = { @@ -19,7 +19,7 @@ const options = { cellPadding: " ", delimiterOnBegin: "|", delimiterOnEnd: "|", - csvComment: "#", + csvComment: "#" }; const csvString = require("fs")