chore: generate
This commit is contained in:
@@ -140,17 +140,10 @@ function collectPaths<T>(items: T[], scores: Array<{ total: number }>, toPath: (
|
|||||||
return [{ text, score: scores[index]?.total ?? 0 }]
|
return [{ text, score: scores[index]?.total ?? 0 }]
|
||||||
})
|
})
|
||||||
rows.sort(
|
rows.sort(
|
||||||
(a, b) =>
|
(a, b) => b.score - a.score || a.text.length - b.text.length || (a.text < b.text ? -1 : a.text > b.text ? 1 : 0),
|
||||||
b.score - a.score ||
|
|
||||||
a.text.length - b.text.length ||
|
|
||||||
(a.text < b.text ? -1 : a.text > b.text ? 1 : 0),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
return Array.from(
|
return Array.from(new Set(rows.map((item) => item.text)))
|
||||||
new Set(
|
|
||||||
rows.map((item) => item.text),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function searchFff(
|
function searchFff(
|
||||||
|
|||||||
Reference in New Issue
Block a user