Skip to content

Commit 22e19bf

Browse files
github-actions[bot]hckhanh
authored andcommitted
chore(release): bump version package
1 parent 5b7ec21 commit 22e19bf

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

.changeset/petite-pumas-flash.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# fast-url
22

3+
## 6.0.2
4+
5+
### Patch Changes
6+
7+
- 5b7ec21: Performance optimizations for path and parameter handling utilities in `src/index.ts`. This release focuses on reducing regex recompilation overhead, optimizing string manipulation for path joining, and improving parameter filtering performance.
8+
9+
**Performance Optimizations:**
10+
11+
- **Pre-compiled regex**: Extracted the path parameter regex (`PATH_PARAM_REGEX`) to module scope to avoid recompiling it on every `path()` call, improving efficiency for path template processing.
12+
- **Optimized `join()` function**: Rewrote to use direct string indexing (`part1[len1 - 1]`, `part2[0]`) instead of `endsWith`/`startsWith` methods, added fast paths for empty strings, and optimized for the most common URL joining scenario where both parts have separators. This reduces unnecessary string slicing and improves speed.
13+
- **Optimized `removeNullOrUndef()` function**: Improved performance by checking for null/undefined values before allocating a new object, and using direct property iteration instead of `Object.entries`/`Object.fromEntries`. This results in faster execution and less memory usage, especially when no filtering is needed.
14+
15+
**Parameter Validation Improvements:**
16+
17+
- Enhanced `validatePathParam()` to check for empty strings in path parameters, ensuring that string path parameters cannot be empty or whitespace-only values.
18+
- Improved code readability by adding blank lines between logical blocks in validation logic.
19+
320
## 6.0.1
421

522
### Patch Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "fast-url",
33
"description": "A folk version of the `urlcat` library focus on performance and simplicity.",
4-
"version": "6.0.1",
4+
"version": "6.0.2",
55
"author": {
66
"name": "Khánh Hoàng",
77
"email": "[email protected]",

0 commit comments

Comments
 (0)