@igniter-js/caller 0.1.56 → 0.1.57

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
@@ -414,11 +414,22 @@ var IgniterCallerUrlUtils = class {
414
414
  if (baseURL && !/^https?:\/\//i.test(url)) {
415
415
  fullUrl = baseURL + url;
416
416
  }
417
- if (query && Object.keys(query).length > 0) {
418
- const queryParams = new URLSearchParams(
419
- Object.entries(query).map(([key, value]) => [key, String(value)])
417
+ const queryParams = {};
418
+ if (query) {
419
+ Object.entries(query).forEach(([key, value]) => {
420
+ const placeholder = `:${key}`;
421
+ if (fullUrl.includes(placeholder)) {
422
+ fullUrl = fullUrl.split(placeholder).join(encodeURIComponent(String(value)));
423
+ } else {
424
+ queryParams[key] = value;
425
+ }
426
+ });
427
+ }
428
+ if (Object.keys(queryParams).length > 0) {
429
+ const queryString = new URLSearchParams(
430
+ Object.entries(queryParams).map(([key, value]) => [key, String(value)])
420
431
  ).toString();
421
- fullUrl += (fullUrl.includes("?") ? "&" : "?") + queryParams;
432
+ fullUrl += (fullUrl.includes("?") ? "&" : "?") + queryString;
422
433
  }
423
434
  return fullUrl;
424
435
  }