Skip to content

Commit

Permalink
fix(js): fix highlight hit param
Browse files Browse the repository at this point in the history
  • Loading branch information
francoischalifour committed Oct 29, 2020
1 parent cb967a4 commit 6c03d8d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/js/app.ts
Expand Up @@ -51,7 +51,7 @@ autocomplete<Hit<QuerySuggestionHit>>({
return `
<div class="item-icon">${searchIcon}</div>
<div>
${reverseHighlightHit({
${reverseHighlightHit<Hit<QuerySuggestionHit>>({
hit: item,
attribute: 'query',
})}
Expand Down
10 changes: 5 additions & 5 deletions packages/autocomplete-js/src/highlight.ts
Expand Up @@ -26,7 +26,7 @@ function concatParts(
}

type HighlightItemParams<TItem> = {
item: TItem;
hit: TItem;
attribute: keyof TItem;
highlightPreTag?: string;
highlightPostTag?: string;
Expand All @@ -37,7 +37,7 @@ type HighlightItemParams<TItem> = {
* Highlights and escapes the matching parts of an Algolia hit.
*/
export function highlightHit<TItem extends Hit<{}>>({
item: hit,
hit,
attribute,
highlightPreTag = '<mark>',
highlightPostTag = '</mark>',
Expand All @@ -59,7 +59,7 @@ export function highlightHit<TItem extends Hit<{}>>({
* This is a common pattern for Query Suggestions.
*/
export function reverseHighlightHit<TItem extends Hit<{}>>({
item: hit,
hit,
attribute,
highlightPreTag = '<mark>',
highlightPostTag = '</mark>',
Expand All @@ -79,7 +79,7 @@ export function reverseHighlightHit<TItem extends Hit<{}>>({
* Highlights and escapes the matching parts of an Algolia hit snippet.
*/
export function snippetHit<TItem extends Hit<{}>>({
item: hit,
hit,
attribute,
highlightPreTag = '<mark>',
highlightPostTag = '</mark>',
Expand All @@ -101,7 +101,7 @@ export function snippetHit<TItem extends Hit<{}>>({
* This is a common pattern for Query Suggestions.
*/
export function reverseSnippetHit<TItem extends Hit<{}>>({
item: hit,
hit,
attribute,
highlightPreTag = '<mark>',
highlightPostTag = '</mark>',
Expand Down

0 comments on commit 6c03d8d

Please sign in to comment.