@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
package/dist/index.cjs
CHANGED
|
@@ -894,6 +894,7 @@ __export(index_exports, {
|
|
|
894
894
|
isUndefined: () => isUndefined,
|
|
895
895
|
isWeakMap: () => isWeakMap,
|
|
896
896
|
isWeakSet: () => isWeakSet,
|
|
897
|
+
joinUrlPath: () => joinUrlPath,
|
|
897
898
|
kebabCase: () => kebabCase,
|
|
898
899
|
keyBy: () => keyBy,
|
|
899
900
|
last: () => last,
|
|
@@ -5879,6 +5880,19 @@ function appendUrlParam(url, param) {
|
|
|
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;
|
|
@@ -6422,6 +6436,7 @@ function isLongitude(s) {
|
|
|
6422
6436
|
isUndefined,
|
|
6423
6437
|
isWeakMap,
|
|
6424
6438
|
isWeakSet,
|
|
6439
|
+
joinUrlPath,
|
|
6425
6440
|
kebabCase,
|
|
6426
6441
|
keyBy,
|
|
6427
6442
|
last,
|