lineStrengthFromAttribute関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The strength from the attribute constellation-lines, read as text. Off (undefined) when the attribute is missing, 0, off or false; constellation-lines with no value is the default strength (0.16); a number is the strength, held to 0 up to 1.
インポート
import { lineStrengthFromAttribute } from "@johnmorrisdotca/hoshi-stars/sky-labels";
定義
function lineStrengthFromAttribute(value: string | null | undefined): number | undefined
引数
| 名前 | 型 | 説明 |
|---|---|---|
value | string | null | undefined | The value of |
戻り値
number | undefined
The strength, or undefined when the lines are off.
例
import { lineStrengthFromAttribute } from "@johnmorrisdotca/hoshi-stars/sky-labels";
console.log(lineStrengthFromAttribute("0.3"), lineStrengthFromAttribute(""), lineStrengthFromAttribute(null), lineStrengthFromAttribute("0"));0.3 0.16 undefined undefined出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。