shelving 1.161.1 → 1.161.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/util/url.js +2 -2
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "state-management",
12
12
  "query-builder"
13
13
  ],
14
- "version": "1.161.1",
14
+ "version": "1.161.2",
15
15
  "repository": "https://github.com/dhoulb/shelving",
16
16
  "author": "Dave Houlbrooke <dave@shax.com>",
17
17
  "license": "0BSD",
package/util/url.js CHANGED
@@ -94,7 +94,7 @@ export function withURLParam(url, key, value, caller = withURLParam) {
94
94
  */
95
95
  export function withURLParams(url, params, caller = withURLParams) {
96
96
  const input = requireURL(url);
97
- const output = requireURL(url);
97
+ const output = new URL(input);
98
98
  for (const [key, str] of getURLEntries(params, caller))
99
99
  output.searchParams.set(key, str);
100
100
  return input.href === output.href ? input : output;
@@ -102,7 +102,7 @@ export function withURLParams(url, params, caller = withURLParams) {
102
102
  /** Return a URL without one or more params (or same URL if no changes were made). */
103
103
  export function omitURLParams(url, ...keys) {
104
104
  const input = requireURL(url);
105
- const output = requireURL(url);
105
+ const output = new URL(input);
106
106
  for (const key of keys)
107
107
  output.searchParams.delete(key);
108
108
  return input.href === output.href ? input : output;