UNPKG

@randsum/dice

Version:

A flexible, type-safe dice roller for tabletop RPGs, game development, and probability simulations

9 lines (8 loc) 303 B
import { generateKey, normalizeArgument, rollResultFromDicePools } from './utils'; function roll(...args) { const dicePools = { dicePools: Object.fromEntries(args.map((arg) => [generateKey(), normalizeArgument(arg)])) }; return rollResultFromDicePools(dicePools); } export { roll };