Skip to content

Commit 9d14478

Browse files
authored
Add 9 new string utility functions (#11)
* new functionality * chore: update version to 0.4.0 and enhance CHANGELOG
1 parent 9353bbd commit 9d14478

21 files changed

+2478
-49
lines changed

CHANGELOG.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.4.0] - 2025-09-03
11+
12+
### Added
13+
14+
- `excerpt` - Create smart text excerpts with word boundary awareness
15+
- `highlight` - Highlight search terms in text with customizable wrappers
16+
- `diff` - Compute simple string diffs showing additions and deletions
17+
- `levenshtein` - Calculate edit distance between strings with early termination
18+
- `levenshteinNormalized` - Normalized Levenshtein similarity score (0-1)
19+
- `fuzzyMatch` - Sublime Text-style fuzzy string matching for command palettes
20+
- `pluralize` - Convert singular words to plural with English grammar rules
21+
- `singularize` - Convert plural words to singular with irregular forms support
22+
23+
### Enhanced
24+
25+
- Support for complex fuzzy matching with scoring algorithms
26+
- Optimized Levenshtein implementation with O(min(m,n)) space complexity
27+
- Smart excerpt generation with punctuation handling
28+
- Configurable highlighting with HTML escaping and word boundary options
29+
- Comprehensive pluralization rules including irregular forms
30+
1031
## [0.3.0] - 2025-09-03
1132

1233
### Added
34+
1335
- `codePoints` - Convert strings into arrays of Unicode code points
1436
- `graphemes` - Split strings into grapheme clusters (emoji-aware)
1537
- `isASCII` - Check if string contains only ASCII characters
@@ -18,6 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1840
- `removeNonPrintable` - Remove control and formatting characters
1941

2042
### Enhanced
43+
2144
- Comprehensive Unicode support across all new utilities
2245
- Support for complex emoji sequences and combining characters
2346
- Configurable options for whitespace normalization and character removal
@@ -27,6 +50,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2750
## [0.2.0] - 2025-09-02
2851

2952
### Added
53+
3054
- `template` - String interpolation with variables and nested object support
3155
- `templateSafe` - HTML-escaped version of template for safe rendering
3256
- `pad` - Pad string on both sides to target length
@@ -42,6 +66,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4266
## [0.1.0] - 2025-09-01
4367

4468
### Added
69+
4570
- Initial release with 15 essential string utilities
4671
- `slugify` - Convert strings to URL-safe slugs
4772
- `truncate` - Truncate strings with ellipsis
@@ -66,12 +91,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6691
- Detailed JSDoc documentation for all functions
6792

6893
### Technical Details
94+
6995
- Built with TypeScript 5.9
7096
- Supports Node.js 18+
7197
- Bundle size < 1KB (minified + gzipped)
7298
- 100% test coverage for utility functions
7399
- Modern build tooling with tsup and Vitest
74100

101+
[0.4.0]: https://github.com/Zheruel/nano-string-utils/releases/tag/v0.4.0
75102
[0.3.0]: https://github.com/Zheruel/nano-string-utils/releases/tag/v0.3.0
76103
[0.2.0]: https://github.com/Zheruel/nano-string-utils/releases/tag/v0.2.0
77-
[0.1.0]: https://github.com/Zheruel/nano-string-utils/releases/tag/v0.1.0
104+
[0.1.0]: https://github.com/Zheruel/nano-string-utils/releases/tag/v0.1.0

0 commit comments

Comments
 (0)