@reforgium/internal 2.0.3 → 2.0.5

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.
@@ -850,6 +850,7 @@ function getChainedValue(obj, path) {
850
850
  }, obj);
851
851
  }
852
852
 
853
+ const encodeSpacesAsPercent20 = (query) => query.replace(/\+/g, '%20');
853
854
  /**
854
855
  * Normalizes a given URL by removing redundant slashes, resolving dot segments,
855
856
  * and ensuring there are no trailing slashes at the end of the URL.
@@ -879,7 +880,9 @@ function fillUrlWithParams(template, params) {
879
880
  if (!params) {
880
881
  return template;
881
882
  }
882
- return template.replace(/:([a-zA-Z0-9_]+)/g, (_, k) => encodeURIComponent(params[k] ?? ''));
883
+ return template.replace(/:([a-zA-Z0-9_]+)/g, (_, key) => {
884
+ return encodeURIComponent(params[key] ?? '').replaceAll('%2F', '/');
885
+ });
883
886
  }
884
887
  /**
885
888
  * Low-level URL helper for appending query parameters to an existing URL.
@@ -921,7 +924,7 @@ function appendQueryParams(url, params, arrayMode = 'comma') {
921
924
  }
922
925
  searchParams.set(key, String(value));
923
926
  }
924
- const nextQuery = searchParams.toString();
927
+ const nextQuery = encodeSpacesAsPercent20(searchParams.toString());
925
928
  return `${base}${nextQuery ? `?${nextQuery}` : ''}${hash}`;
926
929
  }
927
930
  /**
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.0.3",
2
+ "version": "2.0.5",
3
3
  "name": "@reforgium/internal",
4
4
  "description": "Hidden Reforgium foundation package for shared primitives, tokens, and infrastructure.",
5
5
  "author": "rtommievich",