From d5c24cc724b3767129cf36a20f15d73901ec7afb Mon Sep 17 00:00:00 2001 From: Ioan Lucut Date: Thu, 20 Jul 2023 22:13:50 +0300 Subject: [PATCH] Remove line separators (Use LF) --- .editorconfig | 12 ++++++++++++ .env.remote | 2 +- .gitattributes | 1 + src/constants.ts | 10 +++------- src/songsParser.spec.ts | 1 - 5 files changed, 17 insertions(+), 9 deletions(-) create mode 100644 .editorconfig create mode 100644 .gitattributes diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..9a922b7 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = space +trim_trailing_whitespace = true +insert_final_newline = true + +[{*.js,*.ts(x)}] +insert_final_newline = true diff --git a/.env.remote b/.env.remote index 1f1a0cb..59cd0a2 100644 --- a/.env.remote +++ b/.env.remote @@ -1,2 +1,2 @@ SOURCE_DIR=../bes-lyrics/verified -OUT_DIR=/Users/ilucut/WORK/BES/CLOUD DATA/ProPresenter_Generated/ProPresenter_Generated_Version_8 +OUT_DIR=/Users/ilucut/WORK/BES/CLOUD DATA/ProPresenter_Generated/ProPresenter_Generated_Version_9 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..a28056f --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.txt eol=lf diff=astextplain \ No newline at end of file diff --git a/src/constants.ts b/src/constants.ts index a8357c0..788a6c8 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -17,19 +17,15 @@ export const TXT_EXTENSION = '.txt'; export const TEST_FILE = 'TEMPLATE.txt'; export const ALLOWED_CHARS = - ` {}&#!(),-./1234567890:;?ABCDEFGHIJKLMNOPRSTUVWXZYQ[\\]abcdefghijklmnopqrstuvwxyzÎâîăÂȘșĂȚț’”„\n\r`.split( + ` {}&#!(),-./1234567890:;?ABCDEFGHIJKLMNOPRSTUVWXZYQ[\\]abcdefghijklmnopqrstuvwxyzÎâîăÂȘșĂȚț’”„\n`.split( EMPTY_STRING, ); -export const NEW_LINE = '\n'; - -export const CARRIAGE_RETURN = '\r'; - -export const NEW_LINE_TUPLE = `${CARRIAGE_RETURN}${NEW_LINE}`; +export const NEW_LINE_TUPLE = '\n'; export const DOUBLE_LINE_TUPLE = `${NEW_LINE_TUPLE}${NEW_LINE_TUPLE}`; -export const CHARS_SEPARATORS = /[ !(),./:;?”„\r]+/; +export const CHARS_SEPARATORS = /[ !(),./:;?”„\n]+/; export const ALT_SONGS_FILE_SUFFIX = /(- i|- ii)/; diff --git a/src/songsParser.spec.ts b/src/songsParser.spec.ts index 2f66b92..0649229 100644 --- a/src/songsParser.spec.ts +++ b/src/songsParser.spec.ts @@ -363,7 +363,6 @@ describe('songsParser', () => { parseSong( createAdvancedSongMock([ ['v1', ['Subsection 1.1', 'Subsection 1.2'].join(DOUBLE_LINE_TUPLE)], - ['v2', 'Section 2'], ['v3', 'Section 3'], ]),