@base-web-kits/base-tools-ts 1.4.8 → 1.4.9

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.mjs CHANGED
@@ -5602,6 +5602,19 @@ function appendUrlParam(url, param) {
5602
5602
  return base + (qs ? `?${qs}` : "") + hash;
5603
5603
  }
5604
5604
 
5605
+ // src/ts/url/path/index.ts
5606
+ function joinUrlPath(...parts) {
5607
+ const values = parts.filter((part) => !!part);
5608
+ if (!values.length) return "";
5609
+ const [first, ...rest2] = values;
5610
+ const normalizedFirst = first.replace(/\/+$/, "");
5611
+ const normalizedRest = rest2.map((part) => part.replace(/^\/+|\/+$/g, "")).filter(Boolean);
5612
+ if (!normalizedRest.length) {
5613
+ return normalizedFirst || (first.startsWith("/") ? "/" : "");
5614
+ }
5615
+ return `${normalizedFirst}/${normalizedRest.join("/")}`;
5616
+ }
5617
+
5605
5618
  // src/ts/url/qn/index.ts
5606
5619
  function getQnImg(src, option) {
5607
5620
  var _a;
@@ -6145,6 +6158,7 @@ export {
6145
6158
  isUndefined,
6146
6159
  isWeakMap,
6147
6160
  isWeakSet,
6161
+ joinUrlPath,
6148
6162
  kebabCase,
6149
6163
  keyBy,
6150
6164
  last,