tiny-essentials
Version:
Collection of small, essential scripts designed to be used across various projects. These simple utilities are crafted for speed, ease of use, and versatility.
72 lines (46 loc) β’ 2 kB
Markdown
### π§ TinySimpleDice Improvements & API Refinements
This update focuses heavily on enhancing the **TinySimpleDice** system, improving both internal stability and developer-facing clarity. Version **1.24.4** brings expanded dice-expression support, a new tokenizer system, richer typings, better internal transparency.
## π² Major Dice System Enhancements
### **βοΈ Multi-Dice Support (`3d6`, `4d10`, etc.)**
Dice expressions now support quantity-based patterns.
Instead of treating `d6` as a single roll only, TinySimpleDice now correctly resolves:
* `3d6`
* `2d10`
* `5d4`
β¦each consuming multiple values and aggregating the total automatically.
This change improves compatibility with traditional tabletop dice notation.
## β¨ New Tokenization Engine
### **βοΈ `tokenizeValues()`**
Introduced a new function that:
* Replaces dice expressions with computed values
* Tokenizes expressions into numbers and operators
* Supports structured evaluation workflows
* Produces arrays like:
```js
[7, "+", 4, "-", 5]
```
This makes expression parsing safer and dramatically more predictable.
## π Improved Documentation (jsDoc)
This release includes extensive documentation improvements:
* More precise descriptions of dice evaluation steps
* Clearer examples demonstrating multi-dice behavior
* Better internal documentation for each transformation stage
* Expanded jsDoc for:
* `ApplyDiceModifiersResult`
* `ApplyDiceModifiersStep`
* `DiceModifiersValues`
* Tokenization helpers
* Dice pattern matchers
β¦ and new examples added across all typedefs.
These changes improve IDE IntelliSense and reduce onboarding friction for new contributors.
## π Future-Proofing
These internal changes create a foundation for future features such as:
* Roll history tracking
* Expression rewriting
* AST-based dice evaluation
* Modifier chaining
**Full Changelog**: https://github.com/JasminDreasond/Tiny-Essentials/compare/1.24.3...1.24.4