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.

11 lines (7 loc) 1.12 kB
## ✨ New Features & Additions ### ⚙️ **TinyClassManager** (`libs/TinyClassManager.mjs`) A lightweight, immutable manager designed to linearly compose a base class with multiple modular plugins (mixins). It acts as a safe pipeline for class extension. * **🔒 Immutable Chain State:** Each `.use()` call consumes the previous manager instance and returns a new one. This ensures predictable state transitions and prevents unwanted side effects or accidental reuses of an old chain. * **🧩 Smart Dependency Verification:** Plugins can define a `dependencies` array. The manager automatically verifies that all required modules are installed *before* applying the new plugin. If a dependency is missing, it throws a clear, descriptive error. * **🛑 Duplicate Conflict Protection:** Accidentally applying the same plugin twice? The manager actively prevents this by tracking applied plugins and throwing an error if a conflict is detected. * **🛠️ Clean Build Pipeline:** The `.build()` method finalizes the composition, locking the manager and returning the fully compiled class, ready to be instantiated.