reformat code

This commit is contained in:
2020-03-16 21:08:32 +01:00
committed by smuddy
parent 7d58dd9bdd
commit 5e6a30d0e4
2 changed files with 9 additions and 11 deletions

View File

@@ -28,15 +28,15 @@ export interface Section {
})
export class TextRenderingService {
constructor() {
}
private regexSection = /(Strophe|Refrain|Bridge)/;
private regexChords = /\b([CDEFGAHBcdefgahb](#|##|b|bb|sus|maj|maj7|min|aug|\d+|\/[CDEFGAHBcdefgahb])?\b)/;
constructor() {
}
public parse(text: string): Section[] {
const arrayOfLines = text.split(/\r?\n/).filter(_ => _);
const sections = arrayOfLines.reduce((array, line) => {
return arrayOfLines.reduce((array, line) => {
if (line.match(this.regexSection)) return [...array, {
type: this.getSectionTypeOfLine(line),
number: -1,
@@ -45,8 +45,6 @@ export class TextRenderingService {
array[array.length - 1].lines.push(this.getLineOfLineText(line));
return array;
}, [] as Section[]);
return sections;
}
private getLineOfLineText(text: string): Line {