Skip to content

Commit

Permalink
Merge pull request #8 from trosck/fix-set-all-method
Browse files Browse the repository at this point in the history
Fix a bug in the setAll method for undefined properties.
  • Loading branch information
trosck authored Jan 12, 2023
2 parents 70b8461 + e9487fe commit 32afbc5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@ urlParams.setAll({
- [toString](#tostring)
- [License](#license)

<!--
## Features
- **vue-mixin.js** for Vue that reactively updates
values in url -->

## Browser support
![Chrome](https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.githubusercontent.com/alrra/browser-logos/main/src/firefox/firefox_48x48.png) | ![Safari](https://raw.githubusercontent.com/alrra/browser-logos/main/src/safari/safari_48x48.png) | ![Opera](https://raw.githubusercontent.com/alrra/browser-logos/main/src/opera/opera_48x48.png) | ![Edge](https://raw.githubusercontent.com/alrra/browser-logos/main/src/edge/edge_48x48.png) |
--- | --- | --- | --- | --- |
Expand Down
4 changes: 3 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ export class URLParams implements IURLParams {
) {
for (const key in properties) {
if (properties.hasOwnProperty(key)) {
this._url.searchParams.set(key, properties[key].toString())
this._url.searchParams.set(
key, properties[key]?.toString?.() ?? ""
)
}
}
changeUrl(this._url, saveState)
Expand Down

0 comments on commit 32afbc5

Please sign in to comment.