/** "Code or name" search over loaded rows: part of either value, ignoring case; blank matches all. */ export function matchesCodeOrName(row: { code?: string | null; name?: string | null }, term: string): boolean { const needle = term.trim().toLowerCase(); if (!needle) return true; return [row.code, row.name].some((value) => (value ?? "").toLowerCase().includes(needle)); }