@luminix/support 0.4.2 → 0.4.3

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.
package/dist/support.js CHANGED
@@ -4517,10 +4517,19 @@ class xm {
4517
4517
  return this.options = t, this;
4518
4518
  }
4519
4519
  withQueryParameters(t) {
4520
- return O.set(this.options, "params", O.merge(this.options.params, t)), this;
4520
+ const r = typeof t == "string" ? O.fromQuery(new URLSearchParams(t)) : t instanceof URLSearchParams ? O.fromQuery(t) : t;
4521
+ return O.set(
4522
+ this.options,
4523
+ "params",
4524
+ O.merge(this.options.params || {}, r)
4525
+ ), this;
4521
4526
  }
4522
4527
  replaceQueryParameters(t) {
4523
- return O.set(this.options, "params", t), this;
4528
+ return O.set(
4529
+ this.options,
4530
+ "params",
4531
+ typeof t == "string" ? O.fromQuery(new URLSearchParams(t)) : t instanceof URLSearchParams ? O.fromQuery(t) : t
4532
+ ), this;
4524
4533
  }
4525
4534
  withData(t) {
4526
4535
  const r = O.get(this.options, "data", {}), n = r instanceof FormData ? O.fromFormData(r) : r;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luminix/support",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "module": "dist/support.js",
5
5
  "types": "types/index.d.ts",
6
6
  "type": "module",
@@ -13,8 +13,8 @@ export default class Client {
13
13
  replaceHeaders(headers: Record<string, string>): this;
14
14
  withOptions(options: RequestOptions): this;
15
15
  replaceOptions(options: RequestOptions): this;
16
- withQueryParameters(params: string | object): this;
17
- replaceQueryParameters(params: string | object): this;
16
+ withQueryParameters(params: URLSearchParams | string | object): this;
17
+ replaceQueryParameters(params: URLSearchParams | string | object): this;
18
18
  withData(data: object): this;
19
19
  replaceData(data: object): this;
20
20
  withBasicAuth(username: string, password: string): this;