Skip to content

Commit 0a015cb

Browse files
committed
instantsearch.js: Remove unused getClearedItem
If I'm correct, "¶" is now removed at indexation time.
1 parent e8ea216 commit 0a015cb

File tree

1 file changed

+1
-28
lines changed

1 file changed

+1
-28
lines changed

docs/js/instantsearch.js

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,5 @@
11
(function (global, doc) {
2-
const getClearedItem = (item) => {
3-
const REMOVED_PATTERN = '¶';
4-
const hierarchy = Object.entries(item.hierarchy).reduce((output, [hierarchyIndex, hierarchy]) => {
5-
return {
6-
...output,
7-
[hierarchyIndex]: hierarchy?.replace(REMOVED_PATTERN, '') ?? null,
8-
};
9-
}, {});
10-
const highlightResultHierarchy = Object.entries(item._highlightResult.hierarchy).reduce((output, [hierarchyIndex, hierarchy]) => {
11-
return {
12-
...output,
13-
[hierarchyIndex]: {
14-
...hierarchy,
15-
value: hierarchy?.value.replace(REMOVED_PATTERN, '') ?? null,
16-
},
17-
};
18-
}, {});
19-
20-
return {
21-
...item,
22-
hierarchy,
23-
_highlightResult: {
24-
...item._highlightResult,
25-
hierarchy: highlightResultHierarchy,
26-
},
27-
}
28-
}
29-
let match = null;
2+
let match;
303
const search_query = (match = doc.location.search.match(/sq=(.*?)(&|$)/)) ? match[1] : '';
314
const parsed_search_query = decodeURI(search_query.replace('+', ' '));
325
const search_page = (match = doc.location.search.match(/p=(\d*?)(&|$)/)) ? match[1] : 1;

0 commit comments

Comments
 (0)