Train 1D: merge via --admin on .113 validation

Squash merge from local merge-train (Hard Rule owner-approved). Tip 029cdf4215cf465f0e1716ac9f84a84692b1e881 validated on 192.168.0.113: 26631/26653 pass.
This commit is contained in:
Austin Liu
2026-07-28 00:00:39 +09:30
committed by GitHub
parent d78a836d3c
commit 899d19881f
3 changed files with 46 additions and 3 deletions

View File

@@ -47,6 +47,22 @@ export function matchesSearch(
return normalizeForSearch(text).includes(q);
}
/**
* Checks if `text` matches any whitespace-separated token in `query`.
* Returns `true` if `query` is empty or if any token is found in `text`.
*/
export function matchesAnyToken(
text: string | null | undefined,
query: string | null | undefined
): boolean {
const q = normalizeForSearch(query);
if (!q) return true;
const tokens = q.split(/\s+/).filter(Boolean);
if (tokens.length === 0) return true;
const normText = normalizeForSearch(text);
return tokens.some((token) => normText.includes(token));
}
const trCollator = new Intl.Collator("tr", {
sensitivity: "base",
numeric: true,