presetByKey関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The preset with this key, or undefined.
インポート
import { presetByKey } from "@johnmorrisdotca/sugoroku";
定義
function presetByKey(key: string): Preset | undefined
引数
| 名前 | 型 | 説明 |
|---|---|---|
key | string | The native variant, preset or localized-label key specified by the signature. |
戻り値
Preset | undefined
The matching preset, or undefined for an unknown key.
例
import { PRESETS, presetByKey } from "@johnmorrisdotca/sugoroku";
console.log(presetByKey(PRESETS[0].key)?.names);[
'Backgammon',
'Backgammon Level 2',
'Backgammon Level 3',
'Casual Backgammon'
]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。