findNamefunction
The row a name, a designation or an id names exactly, ignoring case, spacing, accents and the Greek letter's spelling: Betelgeuse, alpha Ori, α Orionis, HR 2061, M31, Messier 31, NGC 224, Andromeda Galaxy, ベテルギウス. A text that two rows share (Alpha Centauri) finds none: use searchNames.
Import it
import { findName } from "@johnmorrisdotca/hoshi-stars/names";
Definition
function findName(text: string): NameRow | undefined
Parameters
| Name | Type | Description |
|---|---|---|
text | string | What was typed. |
Returns
NameRow | undefined
The row, or undefined.
Examples
import { findName } from "@johnmorrisdotca/hoshi-stars/names";
console.log(findName("alpha Ori")?.id, findName("HR 2061")?.id, findName("NGC 224")?.id);betelgeuse betelgeuse m31What it prints (run when this page was built)