Skip to content

Function: normalizeSpec() ​

ts
function normalizeSpec(spec, limits?): RollSpec;

Defined in: src/dice.ts:615

A spec brought into range, so a hand-typed or stored one can never roll eleven dice, five kinds or a die with no faces. A part that cannot be kept is left out, never guessed at; checkNotation is the strict reader, and says which part. Two kinds that are the same dice under the same rules become one: 2d6+3d6 is 5d6.

Parameters ​

spec ​

Partial<RollSpec>

limits? ​

maxDice? ​

number

Returns ​

RollSpec

MIT © John Morris