remove falsy values, but do not limit characters

This commit is contained in:
Ulf Gebhardt 2023-04-25 02:15:16 +02:00
parent e2667a1a98
commit a10916fc14
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9

View File

@ -33,7 +33,7 @@ const matchSomeWordsExactly = (str, boost = 2) => {
const matchBeginningOfWords = (str) => {
return str
.split(' ')
.filter((s) => s.length > 3)
.filter((s) => s) // remove falsy values
.map((s) => s + '*')
.join(' ')
}