@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.
@@ -895,6 +895,7 @@ var baseToolsTS = (() => {
895
895
  isUndefined: () => isUndefined,
896
896
  isWeakMap: () => isWeakMap,
897
897
  isWeakSet: () => isWeakSet,
898
+ joinUrlPath: () => joinUrlPath,
898
899
  kebabCase: () => kebabCase,
899
900
  keyBy: () => keyBy,
900
901
  last: () => last,
@@ -5879,6 +5880,19 @@ var baseToolsTS = (() => {
5879
5880
  return base + (qs ? `?${qs}` : "") + hash;
5880
5881
  }
5881
5882
 
5883
+ // src/ts/url/path/index.ts
5884
+ function joinUrlPath(...parts) {
5885
+ const values = parts.filter((part) => !!part);
5886
+ if (!values.length) return "";
5887
+ const [first, ...rest2] = values;
5888
+ const normalizedFirst = first.replace(/\/+$/, "");
5889
+ const normalizedRest = rest2.map((part) => part.replace(/^\/+|\/+$/g, "")).filter(Boolean);
5890
+ if (!normalizedRest.length) {
5891
+ return normalizedFirst || (first.startsWith("/") ? "/" : "");
5892
+ }
5893
+ return `${normalizedFirst}/${normalizedRest.join("/")}`;
5894
+ }
5895
+
5882
5896
  // src/ts/url/qn/index.ts
5883
5897
  function getQnImg(src, option) {
5884
5898
  var _a;