searchNamesfunction
The rows whose names match what was typed: those with a name that starts with it first (an exact name before those), then those that contain it, each by weight (bright and well known first).
Import it
import { searchNames } from "@johnmorrisdotca/hoshi-stars/names";
Definition
function searchNames(text: string, options?: { limit?: number; kinds?: readonly NameKind[]; }): NameRow[]
Parameters
| Name | Type | Description |
|---|---|---|
text | string | What was typed. |
options (optional) | { limit?: number; kinds?: readonly NameKind[]; } |
|
Returns
NameRow[]
The rows, best first.
Examples
import { searchNames } from "@johnmorrisdotca/hoshi-stars/names";
console.log(searchNames("andromeda", { limit: 3 }).map((row) => row.id));[ 'm31', 'alpheratz', 'mirach' ]What it prints (run when this page was built)