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.

27 lines (19 loc) 738 B
### 🛠️ `extendObjType` Function – Release Update **Version:** `1.9.2` **Date:** 2025-05-23 #### ✨ Enhancements * **Flexible Input Support:** The `extendObjType` function now supports multiple input formats for adding new type validators, greatly improving developer ergonomics: * Traditional object syntax: `{ key: fn }` * Array of key/function pairs: `[ ['key', fn], ... ]` #### 📚 Example Usage ```js extendObjType({ htmlElement2: val => typeof HTMLElement !== 'undefined' && val instanceof HTMLElement }); extendObjType([ [ 'alpha', val => typeof val === 'string' ], [ 'beta', val => Array.isArray(val) ] ]); ``` **Full Changelog**: https://github.com/JasminDreasond/Tiny-Essentials/compare/1.9.1...1.9.2