blackHolefunction
A black hole by any of its names, ignoring case, spacing, punctuation and the star after a name: Cygnus X-1, cyg x-1, HDE 226868, V404 Cyg, Sgr A*, M87, M87*, NGC 4486, or its id. A name two black
holes share finds neither.
Import it
import { blackHole } from "@johnmorrisdotca/hoshi-stars/black-holes";
Definition
function blackHole(text: string): BlackHole | undefined
Parameters
| Name | Type | Description |
|---|---|---|
text | string | The name. |
Returns
BlackHole | undefined
The black hole, or undefined if the text names none.
Examples
import { blackHole } from "@johnmorrisdotca/hoshi-stars/black-holes";
console.log(blackHole("Sgr A*")?.massSuns?.value, blackHole("M87")?.distanceParsecs?.value, blackHole("v404 cyg")?.name);4297000 16800000 V404 CygniWhat it prints (run when this page was built)