@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/base-tools-ts.umd.global.js +14 -0
- package/dist/base-tools-ts.umd.global.js.map +1 -1
- package/dist/index.cjs +15 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +14 -0
- package/dist/index.mjs.map +1 -1
- package/dist/url/index.d.ts +1 -0
- package/dist/url/index.d.ts.map +1 -1
- package/dist/url/path/index.d.ts +17 -0
- package/dist/url/path/index.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/ts/url/index.ts +4 -3
- package/src/ts/url/path/index.ts +29 -0
|
@@ -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;
|