Skip to content

Commit

Permalink
Update: Remove the undefined/empty-string values from the request url. (
Browse files Browse the repository at this point in the history
#2532)

* Update: Remove the undefined/empty-string values from the request url.

* Fix: Updated the condition to remove the undefined and empty string values instead of the 'false' values.
  • Loading branch information
Mahmoud-Emad authored Apr 4, 2024
1 parent 6720234 commit 73188aa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/gridproxy_client/src/modules/abstract_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ export abstract class AbstractClient<B, Q> {
}

public builder(queries: Partial<Q> = {}): B {
for (const key of Object.keys(queries)) {
if (queries[key] === undefined || queries[key] === "" || queries[key] === null) {
delete queries[key];
}
}

return new this.__Builder(this.uri, queries);
}
}

0 comments on commit 73188aa

Please sign in to comment.