@base-web-kits/base-tools-ts 1.4.2 → 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/es-toolkit/index.ts +199 -199
- package/src/ts/url/index.ts +4 -3
- package/src/ts/url/path/index.ts +29 -0
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,
|