Skip to content

Commit

Permalink
fix(url-parser): using set was not correctly updating the `searchPa…
Browse files Browse the repository at this point in the history
…rams`
  • Loading branch information
Michael committed Dec 14, 2022
1 parent 0336d58 commit 2dc734a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/core/parsers/url-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,15 @@ export class URLParser extends BaseURLParser {
/**
* Set a component object without enforcing the component to serialize
* or parse. Merges the component with the existing component.
*
* This does not validate the component.
*/
public set(component: SerializeComponent): this {
this.$component = merge(this.$component, component);

if (component.searchParams) {
this.setSearchParams(component.searchParams);
if (component.searchParams instanceof URLSearchParams) {
this.$component.search = component.searchParams.toString();
this.$component.searchParams = component.searchParams;
}

return this;
Expand Down

0 comments on commit 2dc734a

Please sign in to comment.