adding presentation background

This commit is contained in:
2022-08-14 22:11:54 +02:00
parent a02e740c0f
commit e9846b29e5
41 changed files with 212 additions and 104 deletions

View File

@@ -3,13 +3,13 @@ import {Song} from '../modules/songs/services/song';
export function filterSong(song: Song, filterValue: string): boolean {
if (!filterValue) return true;
const textMatch = !!song.text && normalize(song.text).indexOf(normalize(filterValue)) !== -1;
const titleMatch = !!song.title && normalize(song.title).indexOf(normalize(filterValue)) !== -1;
const artistMatch = !!song.title && normalize(song.artist).indexOf(normalize(filterValue)) !== -1;
const textMatch = !!song.text && normalize(song.text)?.indexOf(normalize(filterValue)) !== -1;
const titleMatch = !!song.title && normalize(song.title)?.indexOf(normalize(filterValue)) !== -1;
const artistMatch = !!song.title && normalize(song.artist)?.indexOf(normalize(filterValue)) !== -1;
return textMatch || titleMatch || artistMatch;
}
function normalize(input: string): string {
return input.toLowerCase().replace(/[\s?!.,']/g, '');
return input?.toLowerCase().replace(/[\s?!.,']/g, '');
}