Skip to content

Commit 6421632

Browse files
committed
Fixed linter issues
1 parent 3c4ae14 commit 6421632

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

packages/instant-meilisearch/src/adapter/search-request-adapter/filter-adapter.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,22 @@ function transformFacetFilter(filter: string): string {
4444
* @returns {string}
4545
*/
4646
function transformNumericFilter(filter: string): string {
47-
const splitNumericFilter = ():[string, string, string] => {
48-
const attributeMatch = filter.match(/^([^<!>:=]*)([<!>:=]+)(.*)$/);
47+
const splitNumericFilter = (): [string, string, string] => {
48+
const attributeMatch = filter.match(/^([^<!>:=]*)([<!>:=]+)(.*)$/)
4949

5050
if (attributeMatch) {
51-
const [attribute, dirtyOperator, valueEnd] = attributeMatch.slice(1);
52-
const operatorMatch = dirtyOperator.match(/^([<!>]?=|<|>|:){1}(.*)/) || ["",""]
53-
const [operator, valueStart] = operatorMatch.slice(1);
54-
const cleanedValue = valueStart + valueEnd;
55-
56-
return [attribute, operator, cleanedValue];
51+
const [attribute, dirtyOperator, valueEnd] = attributeMatch.slice(1)
52+
const operatorMatch = dirtyOperator.match(/^([<!>]?=|<|>|:){1}(.*)/) || [
53+
'',
54+
'',
55+
]
56+
const [operator, valueStart] = operatorMatch.slice(1)
57+
const cleanedValue = valueStart + valueEnd
58+
59+
return [attribute, operator, cleanedValue]
5760
}
5861

59-
return [filter, "", ""];
62+
return [filter, '', '']
6063
}
6164

6265
const [attribute, operator, value] = splitNumericFilter()

packages/instant-meilisearch/src/contexts/sort-context.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
*/
1717
export function splitSortString(sortStr: string): string[] {
1818
if (!sortStr) return []
19-
const regex = /[^:]+:(?:asc|desc)/g;
19+
const regex = /[^:]+:(?:asc|desc)/g
2020
const sortRules: string[] = []
2121

22-
let match;
22+
let match
2323
while ((match = regex.exec(sortStr)) !== null) {
2424
sortRules.push(match[0])
2525
}
2626

27-
return sortRules.map(str=>str.replace(/^,+|,+$/, ""))
27+
return sortRules.map((str) => str.replace(/^,+|,+$/, ''))
2828
}

0 commit comments

Comments
 (0)