Skip to content

Commit

Permalink
fix: trim leading and trailing spaces from search terms
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlhw committed Dec 14, 2024
1 parent 3ea9961 commit 25fce04
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/modules/search/functions/processSearchQuery.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
export function processSearchQuery(query: string): string {
return query.trim().includes(" ") ? query.split(" ").join(" & ") : query;
const cleanedQuery = query.trim();

return cleanedQuery.includes(" ")
? cleanedQuery.split(" ").join(" & ")
: cleanedQuery;
}

0 comments on commit 25fce04

Please sign in to comment.