minimalistic-server 0.0.55 → 0.0.56
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/index.mjs +4 -4
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2306,13 +2306,13 @@ function normalizeRoutes(routes, handleServerError) {
|
|
|
2306
2306
|
flattenRecursively(root[prop], newPath, preMiddlewares, postMiddlewares);
|
|
2307
2307
|
}
|
|
2308
2308
|
} else if (typeof root === 'function') {
|
|
2309
|
-
flatten
|
|
2309
|
+
setObjectProperty(flatten, path, wrapInMiddlewares(root, preMiddlewares, postMiddlewares, handleServerError));
|
|
2310
2310
|
}
|
|
2311
2311
|
}
|
|
2312
2312
|
|
|
2313
2313
|
flattenRecursively(routes);
|
|
2314
2314
|
|
|
2315
|
-
const result =
|
|
2315
|
+
const result = Object.create(null);
|
|
2316
2316
|
|
|
2317
2317
|
for (const route in flatten) {
|
|
2318
2318
|
const split = route.split('/').filter(x => x);
|
|
@@ -2328,13 +2328,13 @@ function normalizeRoutes(routes, handleServerError) {
|
|
|
2328
2328
|
|
|
2329
2329
|
for (const fragment of split) {
|
|
2330
2330
|
if (!parent[fragment]) {
|
|
2331
|
-
parent
|
|
2331
|
+
setObjectProperty(parent, fragment, Object.create(null));
|
|
2332
2332
|
}
|
|
2333
2333
|
|
|
2334
2334
|
parent = parent[fragment];
|
|
2335
2335
|
}
|
|
2336
2336
|
|
|
2337
|
-
parent
|
|
2337
|
+
setObjectProperty(parent, `/${method}/`, flatten[route]);
|
|
2338
2338
|
}
|
|
2339
2339
|
|
|
2340
2340
|
return result;
|