lovable-ssr 0.1.17 → 0.1.18
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RouterService.d.ts","sourceRoot":"","sources":["../../src/router/RouterService.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEhE,iBAAS,SAAS,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"RouterService.d.ts","sourceRoot":"","sources":["../../src/router/RouterService.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEhE,iBAAS,SAAS,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAqBjE;AAED,iBAAS,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAG7C;AAED,iBAAS,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAM7D;AAED,iBAAS,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,CAa3F;AACD,6FAA6F;AAC7F,iBAAS,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAGjE;AAED,QAAA,MAAM,aAAa;;;;;;CAMlB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -6,9 +6,24 @@ function matchPath(pathPattern, pathname) {
|
|
|
6
6
|
return true;
|
|
7
7
|
const segments = pathname.split('/').filter(Boolean);
|
|
8
8
|
const patternSegments = pathPattern.split('/').filter(Boolean);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
let pathIndex = 0;
|
|
10
|
+
for (let i = 0; i < patternSegments.length; i++) {
|
|
11
|
+
const p = patternSegments[i];
|
|
12
|
+
if (p === '*') {
|
|
13
|
+
// * matches any remaining segments (0 or more) — e.g. studio/* matches studio/profile/teste/1
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
if (pathIndex >= segments.length)
|
|
17
|
+
return false;
|
|
18
|
+
if (p.startsWith(':')) {
|
|
19
|
+
pathIndex++;
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
if (p !== segments[pathIndex])
|
|
23
|
+
return false;
|
|
24
|
+
pathIndex++;
|
|
25
|
+
}
|
|
26
|
+
return pathIndex === segments.length;
|
|
12
27
|
}
|
|
13
28
|
function isSsrRoute(pathname) {
|
|
14
29
|
const routes = getRoutes();
|