Reference · Rolls and exact odds
parseNotationfunction
A spec from notation, or null when the text is not dice this roller can throw. checkNotation says why.
Import it
import { parseNotation } from "@johnmorrisdotca/korokoro";
Definition
function parseNotation(text: string, options?: NotationOptions): RollSpec | null
Parameters
| Name | Type | Description |
|---|---|---|
text | string | Text to parse, validate or format. |
options (optional) | NotationOptions | Options for this call; omitted fields keep their documented defaults. |
Returns
RollSpec | null
A spec from notation, or null when the text is not dice this roller can throw. checkNotation says why.
Examples
import { parseNotation } from "@johnmorrisdotca/korokoro";
console.log(parseNotation("2d20kh1+5"));{ count: 2, sides: 20, modifier: 5, keep: 'highest' }What it prints (run when this page was built)