reformat code
This commit is contained in:
@@ -24,6 +24,11 @@ export class SongComponent implements OnInit {
|
||||
public faDown = faCaretDown;
|
||||
public keyFormControl: FormControl;
|
||||
|
||||
constructor(
|
||||
private showSongService: ShowSongService,
|
||||
) {
|
||||
}
|
||||
|
||||
public _song: Song;
|
||||
|
||||
@Input()
|
||||
@@ -32,11 +37,6 @@ export class SongComponent implements OnInit {
|
||||
this.keys = !!song ? getScale(song.key) : [];
|
||||
};
|
||||
|
||||
constructor(
|
||||
private showSongService: ShowSongService,
|
||||
) {
|
||||
}
|
||||
|
||||
public ngOnInit(): void {
|
||||
this.keyFormControl = new FormControl(this.showSong.key);
|
||||
this.keyFormControl.valueChanges.subscribe(async value => {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user