@globalart/nestcord 1.7.9 → 1.7.10
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.
|
@@ -11,6 +11,7 @@ export declare class ExplorerService<T extends NestCordBaseDiscovery> extends Re
|
|
|
11
11
|
private readonly metadataScanner;
|
|
12
12
|
private readonly nestcordParamsFactory;
|
|
13
13
|
private readonly wrappers;
|
|
14
|
+
private readonly controllerWrappers;
|
|
14
15
|
constructor(discoveryService: DiscoveryService, externalContextCreator: ExternalContextCreator, metadataScanner: MetadataScanner);
|
|
15
16
|
explore(metadataKey: string): T[];
|
|
16
17
|
private flatMap;
|
|
@@ -32,12 +32,20 @@ let ExplorerService = class ExplorerService extends core_1.Reflector {
|
|
|
32
32
|
const prototype = instance ? Object.getPrototypeOf(instance) : null;
|
|
33
33
|
return instance && prototype && wrapper.isDependencyTreeStatic();
|
|
34
34
|
});
|
|
35
|
+
this.controllerWrappers = this.discoveryService.getControllers().filter((wrapper) => {
|
|
36
|
+
const { instance } = wrapper;
|
|
37
|
+
const prototype = instance ? Object.getPrototypeOf(instance) : null;
|
|
38
|
+
return instance && prototype && wrapper.isDependencyTreeStatic();
|
|
39
|
+
});
|
|
35
40
|
}
|
|
36
41
|
explore(metadataKey) {
|
|
37
42
|
return this.flatMap((wrapper) => this.filterProperties(wrapper, metadataKey));
|
|
38
43
|
}
|
|
39
44
|
flatMap(callback) {
|
|
40
|
-
return
|
|
45
|
+
return [
|
|
46
|
+
...this.wrappers.flatMap(callback).filter(Boolean),
|
|
47
|
+
...this.controllerWrappers.flatMap(callback).filter(Boolean),
|
|
48
|
+
];
|
|
41
49
|
}
|
|
42
50
|
filterProperties({ instance }, metadataKey) {
|
|
43
51
|
const prototype = Object.getPrototypeOf(instance);
|
package/package.json
CHANGED