parseNotation関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A spec from notation, or null when the text is not dice this roller can throw. checkNotation says why.
インポート
import { parseNotation } from "@johnmorrisdotca/korokoro";
定義
function parseNotation(text: string, options?: NotationOptions): RollSpec | null
引数
| 名前 | 型 | 説明 |
|---|---|---|
text | string | Text to parse, validate or format. |
options (省略可) | NotationOptions | Options for this call; omitted fields keep their documented defaults. |
戻り値
RollSpec | null
A spec from notation, or null when the text is not dice this roller can throw. checkNotation says why.
例
import { parseNotation } from "@johnmorrisdotca/korokoro";
console.log(parseNotation("2d20kh1+5"));{ count: 2, sides: 20, modifier: 5, keep: 'highest' }出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。