Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit eb39da1

Browse files
committed
server: Fix build comparator preferring numeric comparators
1 parent 105aa3e commit eb39da1

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/services/search/services/build_comparator.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,8 @@ const numericComparators: Record<string, Comparator<number>> = {
3333
function buildComparator(operator: string, comparedValue: string) {
3434
comparedValue = comparedValue.toLowerCase();
3535

36-
if (operator in numericComparators) {
37-
const floatValue = parseFloat(comparedValue);
38-
if (!isNaN(floatValue)) {
39-
return numericComparators[operator](floatValue);
40-
}
36+
if (operator in numericComparators && !isNaN(+comparedValue)) {
37+
return numericComparators[operator](parseFloat(comparedValue));
4138
}
4239

4340
if (operator in stringComparators) {

0 commit comments

Comments
 (0)