@nestjs/core 11.0.5 → 11.0.7

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.
@@ -78,10 +78,15 @@ class MiddlewareModule {
78
78
  const entriesSortedByDistance = [...configs.entries()].sort(([moduleA], [moduleB]) => {
79
79
  const moduleARef = this.container.getModuleByKey(moduleA);
80
80
  const moduleBRef = this.container.getModuleByKey(moduleB);
81
- if (moduleARef.distance === Number.MAX_VALUE) {
81
+ const isModuleAGlobal = moduleARef.distance === Number.MAX_VALUE;
82
+ const isModuleBGlobal = moduleBRef.distance === Number.MAX_VALUE;
83
+ if (isModuleAGlobal && isModuleBGlobal) {
84
+ return 0;
85
+ }
86
+ if (isModuleAGlobal) {
82
87
  return -1;
83
88
  }
84
- if (moduleBRef.distance === Number.MAX_VALUE) {
89
+ if (isModuleBGlobal) {
85
90
  return 1;
86
91
  }
87
92
  return moduleARef.distance - moduleBRef.distance;
@@ -47,7 +47,12 @@ class RouteInfoPathExtractor {
47
47
  return this.extractNonWildcardPathsFrom(route);
48
48
  }
49
49
  isAWildcard(path) {
50
- return ['*', '/*', '/*/', '*path', '/*path', '(.*)', '/(.*)'].includes(path);
50
+ const isSimpleWildcard = ['*', '/*', '/*/', '(.*)', '/(.*)'];
51
+ if (isSimpleWildcard.includes(path)) {
52
+ return true;
53
+ }
54
+ const wildcardRegexp = /^\/\{.*\}.*|^\/\*.*$/;
55
+ return wildcardRegexp.test(path);
51
56
  }
52
57
  extractNonWildcardPathsFrom({ path, method, version, }) {
53
58
  const versionPaths = this.extractVersionPathFrom(version);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/core",
3
- "version": "11.0.5",
3
+ "version": "11.0.7",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@core)",
5
5
  "author": "Kamil Mysliwiec",
6
6
  "license": "MIT",
@@ -39,7 +39,7 @@
39
39
  "uid": "2.0.2"
40
40
  },
41
41
  "devDependencies": {
42
- "@nestjs/common": "11.0.5"
42
+ "@nestjs/common": "11.0.7"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "@nestjs/common": "^11.0.0",