Skip to content

Commit c5f0299

Browse files
Merge pull request #66 from NaverPayDev/changeset-release/main
🚀 version changed packages
2 parents c0efc63 + e4fbed4 commit c5f0299

File tree

3 files changed

+37
-36
lines changed

3 files changed

+37
-36
lines changed

.changeset/stale-rats-buy.md

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

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,41 @@
11
# @naverpay/nurl
22

3+
## 1.0.0
4+
5+
### Major Changes
6+
7+
- 393bd3d: 🔧 Fix pathname handling and href generation in NURL class
8+
9+
- Previously, when creating an NURL instance with an explicitly empty string ('') for the pathname, the resulting URL automatically defaulted to a root path ('/'). This behavior was inconsistent with the native JavaScript URL object, which retains an empty pathname as-is, resulting in a URL consisting only of query parameters.
10+
11+
```javascript
12+
// as-is
13+
// Input
14+
const url = new NURL({pathname: '', query: {test: '1'}})
15+
16+
// Output
17+
url.href === '/?test=1'
18+
19+
// to-be
20+
// Input
21+
const url = new NURL({pathname: '', query: {test: '1'}})
22+
23+
// Output
24+
url.href === '?test=1'
25+
```
26+
27+
- Previously, assigning an empty string ('') to the pathname property via setter retained the existing pathname. However, to align with the native JavaScript URL object’s behavior, assigning an empty string now explicitly clears the pathname.
28+
29+
```javascript
30+
// Before
31+
url.pathname = '' // pathname remained '/hello'
32+
33+
// After (new default behavior):
34+
url.pathname = '' // pathname becomes '', resulting in removal of '/hello'
35+
```
36+
37+
PR: [🔧 Fix pathname handling and href generation in NURL class](https://github.com/NaverPayDev/nurl/pull/65)
38+
339
## 0.1.1
440

541
### Patch Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@naverpay/nurl",
3-
"version": "0.1.1",
3+
"version": "1.0.0",
44
"description": "URL build library",
55
"main": "./dist/cjs/index.js",
66
"module": "./dist/esm/index.mjs",

0 commit comments

Comments
 (0)