リファレンス · 距離で見る空 (10・50・100・500・1,000光年より近い星や銀河を層に分けて、距離の帯ごとに色分けします。距離がはっきりしないものは別にし、推測で置くことはしません)
limitFromText関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The limit from the attribute distance-limit (and the address's dist), read as text: a number of light-years, or all. Off (undefined) when the attribute is missing, off, or not a number: nothing is limited and the sky is as it was, drawn with no layers.
インポート
import { limitFromText } from "@johnmorrisdotca/hoshi-stars/distance";
定義
function limitFromText(value: string | null | undefined): number | undefined
引数
| 名前 | 型 | 説明 |
|---|---|---|
value | string | null | undefined | The text, or |
戻り値
number | undefined
The limit in light-years (Infinity for all), or undefined for no layers.
例
import { limitFromText } from "@johnmorrisdotca/hoshi-stars/distance";
console.log(limitFromText("100"), limitFromText("all"), limitFromText(null), limitFromText("far"), limitFromText("-5"));100 Infinity undefined undefined undefined出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。