starNamesFromAttributes関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Settings from the two attributes a page offers, star-names (a count) and star-names-magnitude (a limit), read as text. Off when neither is there: names are never on unless asked. star-names with no value ("") asks for 10; a count of 0, a negative or text that is not a number asks for none.
インポート
import { starNamesFromAttributes } from "@johnmorrisdotca/hoshi-stars/sky-labels";
定義
function starNamesFromAttributes(count: string | null | undefined, magnitude: string | null | undefined): StarNamesSettings | undefined
引数
| 名前 | 型 | 説明 |
|---|---|---|
count | string | null | undefined | The value of |
magnitude | string | null | undefined | The value of |
戻り値
StarNamesSettings | undefined
The settings, or undefined when names are off.
例
import { starNamesFromAttributes } from "@johnmorrisdotca/hoshi-stars/sky-labels";
console.log(starNamesFromAttributes("12", null), starNamesFromAttributes(null, "1.5"), starNamesFromAttributes(null, null));{ count: 12 } { magnitude: 1.5 } undefined出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。