Fix the mechanical style rules. [skip build]

This commit is contained in:
2026-11-01 09:01:32 +11:00
parent 831ce01150
commit 9591d8d01b
42 changed files with 762 additions and 756 deletions
+5 -5
View File
@@ -85,13 +85,13 @@ export function fuzzyMatchAny(
texts: Array<string | undefined | null>,
): FuzzyMatch | null {
let best: FuzzyMatch | null = null;
for (const text of texts) {
if (!text) continue;
texts.forEach((text) => {
if (!text) return;
const match = fuzzyMatch(query, text);
if (match && (!best || match.score > best.score)) {
best = match;
}
}
});
return best;
}
@@ -106,12 +106,12 @@ export function fuzzyFilter<T>(
}
const results: Array<{ item: T; score: number }> = [];
for (const item of items) {
items.forEach((item) => {
const match = fuzzyMatchAny(q, getTexts(item));
if (match) {
results.push({ item, score: match.score });
}
}
});
results.sort((a, b) => b.score - a.score);
return results;
}