Skip to content

Commit

Permalink
fix: Relevance sort (#1067)
Browse files Browse the repository at this point in the history
  • Loading branch information
ddeboer committed Aug 8, 2023
1 parent b2cd5dc commit c4a240b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default {
global: {
lines: 90.83,
statements: 90.83,
branches: 93.81,
branches: 93.85,
functions: 89.79,
},
},
Expand Down
4 changes: 2 additions & 2 deletions packages/network-of-terms-query/src/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ export class QueryTermsService {
}

const byScoreThenAlphabetically = (a: Term, b: Term) => {
const scoreA = a.score?.value || 0;
const scoreB = b.score?.value || 0;
const scoreA = parseFloat(a.score?.value ?? '0');
const scoreB = parseFloat(b.score?.value ?? '0');
if (scoreA === scoreB) {
return alphabeticallyByLabels(a, b);
} else {
Expand Down

0 comments on commit c4a240b

Please sign in to comment.