cleanShow関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A value from outside as something that can be shown.
インポート
import { cleanShow } from "@johnmorrisdotca/uchusen-rockets";
定義
function cleanShow(value: unknown, slots: readonly string[]): string
引数
| 名前 | 型 | 説明 |
|---|---|---|
value | unknown | Anything. |
slots | readonly string[] | The variant's slots. |
戻り値
string
The value if it can be shown, and the first choice (together) for anything else.
例
import { cleanShow, variantOf } from "@johnmorrisdotca/uchusen-rockets";
const slots = variantOf("falcon-9", "block-5")?.slots ?? [];
console.log(cleanShow("first-stage", slots), cleanShow("nonsense", slots));first-stage together出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。