Reference · Rolls and exact odds
parseSetsfunction
Sets read back from their text. Anything that is not a sound set is dropped; text that is not a list reads as none.
Import it
import { parseSets } from "@johnmorrisdotca/korokoro";
Definition
function parseSets(text: string | null): DiceSet[]
Parameters
| Name | Type | Description |
|---|---|---|
text | string | null | Text to parse, validate or format. |
Returns
DiceSet[]
Sets read back from their text. Anything that is not a sound set is dropped; text that is not a list reads as none.
Examples
import { parseSets } from "@johnmorrisdotca/korokoro";
import { makeSet, serializeSets } from "@johnmorrisdotca/korokoro";
const set = makeSet("Longsword", "1d8+3")!;
console.log(parseSets(serializeSets([set])).length);1What it prints (run when this page was built)