UNPKG

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.

23 lines (14 loc) 1.1 kB
## ✨ New Features in TinyHtml * **BigInt Support** * `.toBigInt()` / `TinyHtml.toBigInt(el)` – Retrieve BigInt values from elements. * `.setBigInt(value)` / `TinyHtml.setBigInt(el, value)` – Set BigInt content safely, with error handling for invalid inputs. * **Date Support** * `.toDate()` / `TinyHtml.toDate(el)` – Retrieve Date objects from element content. * `.setDate(value)` / `TinyHtml.setDate(el, value)` – Set Date content in ISO format, with validation. * **JSON Support** * `.toJson()` / `TinyHtml.toJson(el)` – Parse JSON content from elements safely (returns `null` if invalid). * `.setJson(value, space)` / `TinyHtml.setJson(el, value, space)` – Set JSON content with optional formatting (`space` parameter for pretty-printing). * **Number Enhancements** * `.toNumber()` / `TinyHtml.toNumber(el)` – Improved parsing of numeric content. * `.setNumber(value)` / `TinyHtml.setNumber(el, value)` – Ensures robust number assignment with proper error checking. **Full Changelog**: https://github.com/JasminDreasond/Tiny-Essentials/compare/1.21.4...1.21.6