mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-06 23:32:12 +03:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user