speedly 2.0.18 → 2.0.20
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.
|
@@ -213,9 +213,17 @@ function RouterFetcher(baseDir) {
|
|
|
213
213
|
const modules = findRoutersInDir(baseDir);
|
|
214
214
|
let paths = {};
|
|
215
215
|
const tags = [];
|
|
216
|
+
// Load each router and analyze
|
|
216
217
|
modules.forEach((routerPath) => {
|
|
217
|
-
const mf =
|
|
218
|
-
|
|
218
|
+
const mf = [
|
|
219
|
+
...new Set(path_1.default
|
|
220
|
+
.relative(baseDir, routerPath)
|
|
221
|
+
.replaceAll(path_1.default.sep, "/")
|
|
222
|
+
.replaceAll(/\.[^/]/g, "")
|
|
223
|
+
.split("/")),
|
|
224
|
+
]
|
|
225
|
+
.join("/")
|
|
226
|
+
.split(".")[0] || "default";
|
|
219
227
|
try {
|
|
220
228
|
const router = require(routerPath);
|
|
221
229
|
paths = { ...paths, ...routeAnalyzer(router, mf) };
|
|
@@ -213,9 +213,17 @@ function RouterFetcher(baseDir) {
|
|
|
213
213
|
const modules = findRoutersInDir(baseDir);
|
|
214
214
|
let paths = {};
|
|
215
215
|
const tags = [];
|
|
216
|
+
// Load each router and analyze
|
|
216
217
|
modules.forEach((routerPath) => {
|
|
217
|
-
const mf =
|
|
218
|
-
|
|
218
|
+
const mf = [
|
|
219
|
+
...new Set(path_1.default
|
|
220
|
+
.relative(baseDir, routerPath)
|
|
221
|
+
.replaceAll(path_1.default.sep, "/")
|
|
222
|
+
.replaceAll(/\.[^/]/g, "")
|
|
223
|
+
.split("/")),
|
|
224
|
+
]
|
|
225
|
+
.join("/")
|
|
226
|
+
.split(".")[0] || "default";
|
|
219
227
|
try {
|
|
220
228
|
const router = require(routerPath);
|
|
221
229
|
paths = { ...paths, ...routeAnalyzer(router, mf) };
|