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 authored Dec 14, 2024
1 parent 3ea9961 commit 6b56293
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/modules/search/functions/processSearchQuery.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export function processSearchQuery(query: string): string {
return query.trim().includes(" ") ? query.split(" ").join(" & ") : query;
const cleanedQuery = query.trim()

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

0 comments on commit 6b56293

Please sign in to comment.