Reference · Rolls and exact odds
makeSetfunction
A set from a name and a roll, or null when the name is empty or too long or the dice cannot be rolled. The name is trimmed.
Import it
import { makeSet } from "@johnmorrisdotca/korokoro";
Definition
function makeSet(name: string, dice: RollSpec | string): DiceSet | null
Parameters
| Name | Type | Description |
|---|---|---|
name | string | The preset or saved-set name to look up or write. |
dice | string | RollSpec | Dice notation, or a callback giving notation for a formula group. |
Returns
DiceSet | null
A set from a name and a roll, or null when the name is empty or too long or the dice cannot be rolled. The name is trimmed.
Examples
import { makeSet } from "@johnmorrisdotca/korokoro";
console.log(makeSet("Longsword", "1d8+3"));{ name: 'Longsword', notation: '1d8+3' }What it prints (run when this page was built)