v0.5.1 - Regex Performance Optimization
🚀 Performance Improvements
This release focuses on optimizing regex patterns across the entire codebase for significant performance improvements.
✨ What's Changed
Performance Optimizations
- Pre-compiled all static regex patterns across 21 functions for 2-3x performance improvement
- Case Conversion (8 functions):
camelCase,pascalCase,kebabCase,snakeCase,constantCase,dotCase,pathCase- pre-compiled 5-7 patterns each - HTML Processing (4 functions):
escapeHtml,stripHtml,highlight- optimized regex and lookup tables - Text Processing (6 functions):
sentenceCase(10 patterns),titleCase(4 patterns),fuzzyMatch,slugify,pluralize,deburr - Utilities (3 functions):
wordCount,isEmail,excerpt- eliminated regex recreation overhead - Combined sequential replacements in
highlightfunction for single-pass HTML escaping
📊 Results
- ✅ All 822 tests pass with 97.72% coverage
- ✅ Bundle size maintained under 6KB (5.64 kB ESM, 5.97 kB CJS)
- ✅ No breaking changes - same API preserved
📦 Installation
npm install [email protected]Full Changelog: v0.5.0...v0.5.1