@nestjs/core 10.0.1 → 10.0.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/middleware/builder.js +10 -5
- package/package.json +2 -2
package/middleware/builder.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MiddlewareBuilder = void 0;
|
|
4
4
|
const dependencies_decorator_1 = require("@nestjs/common/decorators/core/dependencies.decorator");
|
|
5
|
+
const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
|
|
5
6
|
const iterare_1 = require("iterare");
|
|
6
7
|
const utils_1 = require("./utils");
|
|
7
8
|
class MiddlewareBuilder {
|
|
@@ -63,17 +64,21 @@ MiddlewareBuilder.ConfigProxy = class {
|
|
|
63
64
|
const routesWithRegex = routes
|
|
64
65
|
.filter(route => route.path.includes(':'))
|
|
65
66
|
.map(route => ({
|
|
67
|
+
method: route.method,
|
|
66
68
|
path: route.path,
|
|
67
69
|
regex: new RegExp('^(' + route.path.replace(regexMatchParams, wildcard) + ')$', 'g'),
|
|
68
70
|
}));
|
|
69
71
|
return routes.filter(route => {
|
|
70
|
-
const isOverlapped = (
|
|
71
|
-
|
|
72
|
+
const isOverlapped = (item) => {
|
|
73
|
+
if (route.method !== item.method) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
const normalizedRoutePath = (0, shared_utils_1.stripEndSlash)(route.path);
|
|
77
|
+
return (normalizedRoutePath !== item.path &&
|
|
78
|
+
item.regex.test(normalizedRoutePath));
|
|
72
79
|
};
|
|
73
80
|
const routeMatch = routesWithRegex.find(isOverlapped);
|
|
74
|
-
|
|
75
|
-
return route;
|
|
76
|
-
}
|
|
81
|
+
return routeMatch === undefined;
|
|
77
82
|
});
|
|
78
83
|
}
|
|
79
84
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/core",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.3",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@core)",
|
|
5
5
|
"author": "Kamil Mysliwiec",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"uid": "2.0.2"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@nestjs/common": "10.0.
|
|
39
|
+
"@nestjs/common": "10.0.3"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@nestjs/common": "^10.0.0",
|