@hyper-fetch/core 7.5.0 → 7.5.1

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/index.js CHANGED
@@ -2986,8 +2986,9 @@ var getAdapter = () => new Adapter({
2986
2986
  onRequestProgress,
2987
2987
  onSuccess
2988
2988
  }) {
2989
- const { method, client, endpoint } = request;
2990
- const fullUrl = `${client.url}${endpoint}`;
2989
+ const { method, client, endpoint, queryParams } = request;
2990
+ const queryString = queryParams ? stringifyQueryParams(queryParams) : "";
2991
+ const fullUrl = `${client.url}${endpoint}${queryString}`;
2991
2992
  const xhr = new XMLHttpRequest();
2992
2993
  xhr.timeout = defaultTimeout;
2993
2994
  const onAbort = () => xhr.abort();
@@ -3061,7 +3062,7 @@ var getAdapter2 = () => new Adapter({
3061
3062
  onSuccess
3062
3063
  }) {
3063
3064
  var _a;
3064
- const { method, client, endpoint } = request;
3065
+ const { method, client, endpoint, queryParams } = request;
3065
3066
  const { url } = client;
3066
3067
  const httpClient = client.url.includes("https://") ? import_https.default : import_http3.default;
3067
3068
  const options = {
@@ -3079,7 +3080,8 @@ var getAdapter2 = () => new Adapter({
3079
3080
  if (payload) {
3080
3081
  options.headers["Content-Length"] = Buffer.byteLength(JSON.stringify(payload));
3081
3082
  }
3082
- const fullUrl = `${url}${endpoint}`;
3083
+ const queryString = queryParams ? stringifyQueryParams(queryParams) : "";
3084
+ const fullUrl = `${url}${endpoint}${queryString}`;
3083
3085
  const unmountListener = createAbortListener({
3084
3086
  status: 0,
3085
3087
  extra: xhrExtra