@jay-framework/stack-route-scanner 0.15.2 → 0.15.3
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/index.mjs +12 -11
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -143,18 +143,19 @@ async function scanRoutes(baseDir, options) {
|
|
|
143
143
|
return sortedRoutes;
|
|
144
144
|
}
|
|
145
145
|
function routeToExpressRoute(route) {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
146
|
+
const parts = [];
|
|
147
|
+
for (const segment of route.segments) {
|
|
148
|
+
if (typeof segment === "string") {
|
|
149
|
+
parts.push("/" + segment);
|
|
150
|
+
} else if (segment.type === JayRouteParamType.single) {
|
|
151
|
+
parts.push("/:" + segment.name);
|
|
152
|
+
} else if (segment.type === JayRouteParamType.optional) {
|
|
153
|
+
parts.push("{/:" + segment.name + "}");
|
|
154
|
+
} else {
|
|
155
|
+
parts.push("/*" + segment.name);
|
|
156
156
|
}
|
|
157
|
-
}
|
|
157
|
+
}
|
|
158
|
+
return parts.length === 0 ? "/" : parts.join("");
|
|
158
159
|
}
|
|
159
160
|
export {
|
|
160
161
|
JayRouteParamType,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jay-framework/stack-route-scanner",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.mts",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"readme.md"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@jay-framework/logger": "^0.15.
|
|
12
|
+
"@jay-framework/logger": "^0.15.3",
|
|
13
13
|
"node-html-parser": "^6.1.12",
|
|
14
14
|
"yaml": "^2.3.4"
|
|
15
15
|
},
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"test:watch": "vitest"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@jay-framework/dev-environment": "^0.15.
|
|
28
|
+
"@jay-framework/dev-environment": "^0.15.3",
|
|
29
29
|
"@types/node": "^20.11.5",
|
|
30
30
|
"nodemon": "^3.0.3",
|
|
31
31
|
"replace-in-file": "^7.1.0",
|