@yimingliao/cms 0.0.190 → 0.0.192

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.
@@ -1,7 +1,17 @@
1
1
  function joinUrl(...parts) {
2
- return parts.filter(Boolean).map(
3
- (part, i) => i === 0 ? part.replace(/\/+$/, "") : part.replace(/^\/+|\/+$/g, "")
4
- ).join("/");
2
+ const filtered = parts.filter(
3
+ (part) => part !== void 0 && part !== null && part !== ""
4
+ );
5
+ if (filtered.length === 0) return "";
6
+ const segments = filtered.map((part, index) => {
7
+ if (index === 0) {
8
+ return part.replace(/\/+$/, "");
9
+ }
10
+ return part.replace(/^\/+|\/+$/g, "");
11
+ });
12
+ const result = segments.join("/");
13
+ if (result === "") return "/";
14
+ return result;
5
15
  }
6
16
 
7
17
  export { joinUrl };
@@ -1,2 +1,2 @@
1
- export declare function joinUrl(...parts: string[]): string;
1
+ export declare function joinUrl(...parts: (string | null | undefined)[]): string;
2
2
  //# sourceMappingURL=join-url.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"join-url.d.ts","sourceRoot":"","sources":["../../../../../src/shared/utils/join-url.ts"],"names":[],"mappings":"AAAA,wBAAgB,OAAO,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,UAOzC"}
1
+ {"version":3,"file":"join-url.d.ts","sourceRoot":"","sources":["../../../../../src/shared/utils/join-url.ts"],"names":[],"mappings":"AAAA,wBAAgB,OAAO,CAAC,GAAG,KAAK,EAAE,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,UAuB9D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yimingliao/cms",
3
- "version": "0.0.190",
3
+ "version": "0.0.192",
4
4
  "author": "Yiming Liao",
5
5
  "license": "MIT",
6
6
  "type": "module",