Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
csillag committed Jul 4, 2023
1 parent ab8cd75 commit fabec01
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/app/components/Search/search-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,13 @@ export const validateAndNormalize = {
} satisfies Record<string, ValidatorFunction>

export function isSearchValid(searchTerm: string, t?: TFunction) {
return Object.values(validateAndNormalize).some((fn: ValidatorFunction) => !!fn(searchTerm, t))
return Object.values(validateAndNormalize).some((fn: ValidatorFunction) => {
try {
return !!fn(searchTerm, t)
} catch (error) {
return false
}
})
}

export const getSearchParamLoader =
Expand Down

0 comments on commit fabec01

Please sign in to comment.