aboutsummaryrefslogtreecommitdiffstats
path: root/src/helpers/searchSong.ts
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2026-06-26 21:55:46 -0700
committerPinapelz <yukais@pinapelz.com>2026-06-26 21:55:46 -0700
commit00d476a0e51629f06407aed035fbc001d3f6b114 (patch)
tree016338cc4dacff54ba1cbe11fce063152cbd28ab /src/helpers/searchSong.ts
parent84fbd4ee1e159b0426d664cc98a3dc7165d6381f (diff)
initial guess MV mode
Diffstat (limited to 'src/helpers/searchSong.ts')
-rw-r--r--src/helpers/searchSong.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/helpers/searchSong.ts b/src/helpers/searchSong.ts
index 62091b6..3bbecad 100644
--- a/src/helpers/searchSong.ts
+++ b/src/helpers/searchSong.ts
@@ -5,10 +5,11 @@ function fuzzyMatch(input: string): string {
return input.toLowerCase().replace(/[^0-9a-z ]/gi, "");
}
-export function searchSong(searchTerm: string): Song[] {
+export function searchSong(searchTerm: string, pool?: Song[]): Song[] {
const normalizedSearch = fuzzyMatch(searchTerm);
+ const source = pool ?? songs; //if no pool is provided, use the default k-heardle songs list
- return songs
+ return source
.filter((song: Song) => {
const songName = fuzzyMatch(song.name);
const songArtist = fuzzyMatch(song.artist);
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage