Skip to content

Commit

Permalink
feat: add fuzzy param to formatSearch path
Browse files Browse the repository at this point in the history
  • Loading branch information
Emanuel Ramos authored and Emanuel Ramos committed Sep 19, 2024
1 parent 46844b8 commit 7b333fa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/core/src/sdk/search/formatSearchPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ import { formatSearchState, initSearchState } from '@faststore/sdk'
type FormatSearchPath = {
term: string
sort?: SearchState['sort']
fuzzy?: string
}

export const formatSearchPath = ({ term, sort }: FormatSearchPath) => {
export const formatSearchPath = ({ term, sort, fuzzy }: FormatSearchPath) => {
const { pathname, search } = formatSearchState(
initSearchState({
term,
sort,
base: '/s',
fuzzy: fuzzy ?? 'auto',
})
)

Expand Down

0 comments on commit 7b333fa

Please sign in to comment.