Reference · Rolls and exact odds
readSharedManyfunction
A shared set of rolls from a query string, or null when it does not hold one: as many rolls as the notation's # says, each with faces its dice could show.
Import it
import { readSharedMany } from "@johnmorrisdotca/korokoro";
Definition
function readSharedMany(query: string | URLSearchParams): Roll[] | null
Parameters
| Name | Type | Description |
|---|---|---|
query | string | URLSearchParams | A query string or URLSearchParams containing the shared settings. |
Returns
Roll[] | null
A shared set of rolls from a query string, or null when it does not hold one: as many rolls as the notation's # says, each with faces its dice could show.
Examples
import { readSharedMany } from "@johnmorrisdotca/korokoro";
import { normalizeSpec, rollFrom, shareQueryMany } from "@johnmorrisdotca/korokoro";
const spec = normalizeSpec({ count: 2, sides: 6 });
const sample = rollFrom(spec, [2, 5], "saved", 0, null)!;
console.log(readSharedMany(shareQueryMany([sample, sample]))?.length);2What it prints (run when this page was built)