| author | |
| committer | |
| log | 86f079964b9c3d2a087907d2ef8273c3dbcb960b |
| tree | 140b807bc8e462cc440c1753029085d58e6e1178 |
| parent | f5d9d12026d98b2b4b975f1944e7503d6c2c9eb3 |
| signature | Signed by PGP key B5690EEEBB952194 |
2 files changed, 1 insertions(+), 3 deletions(-)
packages/shared/src/searchRanking.test.ts-2| ... | ... | @@ -1,7 +1,6 @@ |
| 1 | 1 | import { describe, expect, it } from "vite-plus/test"; |
| 2 | 2 | |
| 3 | 3 | import { |
| 4 | compareRankedSearchResults, | |
| 5 | 4 | insertRankedSearchResult, |
| 6 | 5 | normalizeSearchQuery, |
| 7 | 6 | scoreQueryMatch, |
| ... | ... | @@ -90,6 +89,5 @@ describe("insertRankedSearchResult", () => { |
| 90 | 89 | insertRankedSearchResult(ranked, { item: "c", score: 30, tieBreaker: "c" }, 2); |
| 91 | 90 | |
| 92 | 91 | expect(ranked.map((entry) => entry.item)).toEqual(["a", "b"]); |
| 93 | expect(compareRankedSearchResults(ranked[0]!, ranked[1]!)).toBeLessThan(0); | |
| 94 | 92 | }); |
| 95 | 93 | }); |
packages/shared/src/searchRanking.ts+1-1| ... | ... | @@ -135,7 +135,7 @@ export function scoreQueryMatch(input: { |
| 135 | 135 | return null; |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | export function compareRankedSearchResults<T>( | |
| 138 | function compareRankedSearchResults<T>( | |
| 139 | 139 | left: RankedSearchResult<T>, |
| 140 | 140 | right: RankedSearchResult<T>, |
| 141 | 141 | ): number { |