From 3edc57d108678b8db1f44cab361630fbb5ba1191 Mon Sep 17 00:00:00 2001 From: Sergey Belov Date: Thu, 12 Jan 2023 13:47:21 +0300 Subject: [PATCH 1/2] remove comment --- README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/README.md b/README.md index ad36dee..75a61a3 100644 --- a/README.md +++ b/README.md @@ -51,11 +51,6 @@ urlParams.setAll({ - [toString](#tostring) - [License](#license) - - ## 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) | --- | --- | --- | --- | --- | From e9487fe23592bf6a191bbb813265b09acee187a9 Mon Sep 17 00:00:00 2001 From: Sergey Belov Date: Thu, 12 Jan 2023 13:48:15 +0300 Subject: [PATCH 2/2] fix setAll for undefined properties --- index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.ts b/index.ts index e69f4df..2712520 100644 --- a/index.ts +++ b/index.ts @@ -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)