Releases: apsonex/js-utils
Releases · apsonex/js-utils
1.0.9
🛠 Fix: Event Listener Cleanup Support
Event listeners registered via events.<name>.listen() now return a cleanup function, allowing proper removal of listeners (e.g. in onBeforeUnmount in Vue). This prevents memory leaks and ensures multiple listeners can coexist safely.
Usage:
const unlisten = events.insertPlaceholder.listen((payload) => {
// handle event
});
onBeforeUnmount(() => {
unlisten(); // clean up
});1.0.8
1.0.7
🔖 Release: 1.0.7 – Enhanced String Utilities & Improvements
✨ What's New
🔡 String Enhancements (str)
-
✅
sentenseCase()
Converts strings like"HELLO_WORLD"or"hello_world"into"Hello World". Ideal for formatting constants, slugs, or identifiers into readable labels. -
✅
capitalizeWords()
Capitalizes the first letter of every word:
'make javascript readable'→'Make Javascript Readable' -
🧼 Internally added
resolveValue()to normalize input across all string methods.
📚 Updated Documentation
README.mdupdated with:- New examples for
sentenseCase()andcapitalizeWords() - Complete list of all chainable
strmethods
- New examples for
🐛 Fixes & Improvements
- Refactored string methods to consistently handle edge cases and non-string inputs
- Improved reliability and output formatting in various utilities
📦 Module Highlights
- 🔡
str()– Laravel-like chainable string manipulation - 💾
JsCache– localStorage cache with TTL support - 📜
loadScript/loadStyle– asset loading with deduplication - 🧩 DOM helpers –
bodyScrollDisable,isIframe, etc. - 📡
Events– iframe ↔ parent messaging made simple - 🔁
Pipeline– sync/async task flow utility
🚀 Install or Upgrade
npm install @apsonex/js-utils@latest
# or
yarn add @apsonex/js-utils@latest