Reference · Satellites: orbital elements in, positions out
findInCataloguefunction
Find catalogue entries by name, group name, NORAD number, Japanese name or a group's Japanese label: "hubble", "hst", "25544", "weather" or "ハッブル".
An English or numeric query ignores case, spaces and punctuation, as before. Japanese is folded on both sides: letter case, character width (NFKC) and kana (foldKana: hiragana to katakana, small kana to full-size, the long-vowel mark left alone), so はっぶる finds ハッブル; kanji are matched as typed. The width fold is applied before the English comparison too.
A name that starts with the text comes before one that only has it inside.
Import it
import { findInCatalogue } from "@johnmorrisdotca/chikyu-earth/satellites";
Definition
function findInCatalogue(text: string, limit?: number): CatalogueEntry[]
Parameters
| Name | Type | Description |
|---|---|---|
text | string | What the reader typed. |
limit (optional) | number | The most entries to give back (8 by default). |
Returns
CatalogueEntry[]
The matching entries, best first; none for empty text.
Examples
import { findInCatalogue } from "@johnmorrisdotca/chikyu-earth/satellites";
console.log(findInCatalogue("sentinel 2").map((entry) => entry.name));
console.log(findInCatalogue("ハッブル").map((entry) => entry.name));[ 'SENTINEL-2A', 'SENTINEL-2B' ]
[ 'HST' ]What it prints (run when this page was built)