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.

33 lines (23 loc) β€’ 1.16 kB
### ✨ What’s New * **TinyHtml now supports `classCanWhitespace`** πŸŽ‰ You can now configure whether class names with whitespace are allowed or not! * `TinyHtml.classCanWhitespace = true` β†’ βœ… enables whitespace in class names * `TinyHtml.classCanWhitespace = false` β†’ 🚫 disallows whitespace in class names * Any non-boolean value will throw a **TypeError** for extra safety πŸ”’ ### πŸš€ Why it matters This gives you **more control and consistency** when working with DOM elements, ensuring that your projects can enforce stricter or looser rules depending on your coding style. ### πŸ›  Example ```js // Enable whitespace in class names TinyHtml.classCanWhitespace = true; elem.addClass('pudding mio'); console.log(TinyHtml.classCanWhitespace); // true // Disable whitespace in class names TinyHtml.classCanWhitespace = false; elem.addClass('pudding'); console.log(TinyHtml.classCanWhitespace); // false // ❌ Throws error TinyHtml.classCanWhitespace = "yes"; // -> Uncaught TypeError: classCanWhitespace must be a boolean ``` **Full Changelog**: https://github.com/JasminDreasond/Tiny-Essentials/compare/1.23.1...1.23.2