findNamefunction
The row of the small chunk that a name, a designation or an id names exactly, ignoring case, spacing, accents and the Greek letter's spelling (Betelgeuse, alpha Ori, HR 2061, M31, NGC 224, ベテルギウス), or undefined. A text that two rows share finds none.
Import it
import { findName } from "@johnmorrisdotca/hoshi-stars/names/named";
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/named";
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)