We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 08fce4a commit 58fcd88Copy full SHA for 58fcd88
packages/core/middleware/middleware-module.ts
@@ -150,13 +150,17 @@ export class MiddlewareModule<
150
([moduleA], [moduleB]) => {
151
const moduleARef = this.container.getModuleByKey(moduleA)!;
152
const moduleBRef = this.container.getModuleByKey(moduleB)!;
153
- if (moduleARef.distance === Number.MAX_VALUE) {
+ const isModuleAGlobal = moduleARef.distance === Number.MAX_VALUE;
154
+ const isModuleBGlobal = moduleBRef.distance === Number.MAX_VALUE;
155
+ if (isModuleAGlobal && isModuleBGlobal) {
156
+ return 0;
157
+ }
158
+ if (isModuleAGlobal) {
159
return -1;
160
}
- if (moduleBRef.distance === Number.MAX_VALUE) {
161
+ if (isModuleBGlobal) {
162
return 1;
163
-
164
return moduleARef.distance - moduleBRef.distance;
165
},
166
);
0 commit comments