/** * The one derivation of a row's `searchNames` from the names it holds. * * `searchNames` is what a lookup queries — never `name`, which reaches neither * the 1,673 alternate names leagues hold nor an accented spelling of its own. * Both sides of that lookup pass through `foldName`, so the derivation is * nothing more than "fold everything the row answers to, once each". * * It lives here rather than inside the script that first populated the field * because its callers must not drift: the model's pre-save hook, and the * reviewed scripts in `api-gateway/scripts` that write a league's names * out-of-band. A second copy is how Cities ended up with `$addToSet` writing * aliases into `alternateNames` that never reached `searchNames`, so the alias * write of the day put in names nothing could find * (`weekendgoals-scraper/src/ingest-opta-rankings.ts`). * * There is no longer a runtime caller. `POST /ingest/leagues/classify` used to * append alternate names and refresh this field in the same operation; Q-3 * narrowed that endpoint to `rating`, so nothing on a schedule writes a name * and nothing on a schedule needs to re-derive `searchNames`. Production league * rows therefore get the field at import time and not before. * * Two properties callers rely on: * * - **The display name folds first.** Order is not meaningful to a query — the * index is multikey and equality matches any element — but it makes the * stored array readable, and it keeps the output stable so a rerun writes * nothing. * - **Duplicates collapse.** 33 leagues hold an alias equal to their own * display name and 19 hold two aliases that fold to the same string; both are * harmless and neither should produce two identical index entries. * * A name that folds to nothing (punctuation only) contributes nothing. */ export declare function searchNamesFor(name?: string, alternateNames?: string[]): string[]; //# sourceMappingURL=search-names.d.ts.map