@esmx/router 3.0.0-rc.53 → 3.0.0-rc.55
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/location.mjs +2 -1
- package/dist/route.d.ts +2 -2
- package/package.json +2 -2
- package/src/location.ts +3 -2
- package/src/route.ts +2 -2
package/dist/location.mjs
CHANGED
|
@@ -4,7 +4,8 @@ export function normalizeURL(url, base) {
|
|
|
4
4
|
return url;
|
|
5
5
|
}
|
|
6
6
|
if (url.startsWith("//")) {
|
|
7
|
-
|
|
7
|
+
const protocol = base.protocol;
|
|
8
|
+
return new URL("".concat(protocol).concat(url));
|
|
8
9
|
}
|
|
9
10
|
if (url.startsWith("/")) {
|
|
10
11
|
const newBase = new URL(".", base);
|
package/dist/route.d.ts
CHANGED
|
@@ -36,8 +36,8 @@ export declare class Route {
|
|
|
36
36
|
readonly path: string;
|
|
37
37
|
readonly fullPath: string;
|
|
38
38
|
readonly hash: string;
|
|
39
|
-
readonly params: Record<string, string
|
|
40
|
-
readonly paramsArray: Record<string, string[]
|
|
39
|
+
readonly params: Record<string, string>;
|
|
40
|
+
readonly paramsArray: Record<string, string[]>;
|
|
41
41
|
readonly query: Record<string, string | undefined>;
|
|
42
42
|
readonly queryArray: Record<string, string[] | undefined>;
|
|
43
43
|
readonly meta: RouteMeta;
|
package/package.json
CHANGED
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"unbuild": "3.5.0",
|
|
40
40
|
"vitest": "3.2.4"
|
|
41
41
|
},
|
|
42
|
-
"version": "3.0.0-rc.
|
|
42
|
+
"version": "3.0.0-rc.55",
|
|
43
43
|
"type": "module",
|
|
44
44
|
"private": false,
|
|
45
45
|
"exports": {
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"template",
|
|
59
59
|
"public"
|
|
60
60
|
],
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "e7d0c88a376ad5bd3d88a48240e4ed4891c0b275"
|
|
62
62
|
}
|
package/src/location.ts
CHANGED
|
@@ -14,8 +14,9 @@ export function normalizeURL(url: string | URL, base: URL): URL {
|
|
|
14
14
|
|
|
15
15
|
// Handle protocol-relative URLs (e.g., //example.com)
|
|
16
16
|
if (url.startsWith('//')) {
|
|
17
|
-
//
|
|
18
|
-
|
|
17
|
+
// Use the current base URL's protocol for security and consistency
|
|
18
|
+
const protocol = base.protocol;
|
|
19
|
+
return new URL(`${protocol}${url}`);
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
// Handle root-relative paths
|
package/src/route.ts
CHANGED
|
@@ -120,8 +120,8 @@ export class Route {
|
|
|
120
120
|
public readonly path: string;
|
|
121
121
|
public readonly fullPath: string;
|
|
122
122
|
public readonly hash: string;
|
|
123
|
-
public readonly params: Record<string, string
|
|
124
|
-
public readonly paramsArray: Record<string, string[]
|
|
123
|
+
public readonly params: Record<string, string> = {};
|
|
124
|
+
public readonly paramsArray: Record<string, string[]> = {};
|
|
125
125
|
public readonly query: Record<string, string | undefined> = {};
|
|
126
126
|
public readonly queryArray: Record<string, string[] | undefined> = {};
|
|
127
127
|
public readonly meta: RouteMeta;
|