@nestjs/core 11.0.12 → 11.0.13
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.
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { InjectionToken } from '@nestjs/common';
|
|
2
|
+
import { InstanceWrapper } from '../../injector/instance-wrapper';
|
|
3
|
+
export declare function getInstancesGroupedByHierarchyLevel(...collections: Array<Map<InjectionToken, InstanceWrapper> | Array<[InjectionToken, InstanceWrapper]>>): Map<number, unknown[]>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getInstancesGroupedByHierarchyLevel = getInstancesGroupedByHierarchyLevel;
|
|
4
|
+
function getInstancesGroupedByHierarchyLevel(...collections) {
|
|
5
|
+
const groupedByHierarchyLevel = new Map();
|
|
6
|
+
for (const collection of collections) {
|
|
7
|
+
for (const [_, wrapper] of collection) {
|
|
8
|
+
if (!wrapper.isDependencyTreeStatic()) {
|
|
9
|
+
continue;
|
|
10
|
+
}
|
|
11
|
+
const level = wrapper.hierarchyLevel;
|
|
12
|
+
if (!groupedByHierarchyLevel.has(level)) {
|
|
13
|
+
groupedByHierarchyLevel.set(level, []);
|
|
14
|
+
}
|
|
15
|
+
const byHierarchyLevelGroup = groupedByHierarchyLevel.get(level);
|
|
16
|
+
if (wrapper.isTransient) {
|
|
17
|
+
const staticTransientInstances = wrapper
|
|
18
|
+
.getStaticTransientInstances()
|
|
19
|
+
.filter(i => !!i)
|
|
20
|
+
.map(i => i.instance);
|
|
21
|
+
byHierarchyLevelGroup.push(...staticTransientInstances);
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
if (wrapper.instance) {
|
|
25
|
+
byHierarchyLevelGroup.push(wrapper.instance);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return groupedByHierarchyLevel;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getSortedHierarchyLevels(groups: Map<number, unknown[]>, order?: 'ASC' | 'DESC'): number[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSortedHierarchyLevels = getSortedHierarchyLevels;
|
|
4
|
+
function getSortedHierarchyLevels(groups, order = 'ASC') {
|
|
5
|
+
const comparator = order === 'ASC'
|
|
6
|
+
? (a, b) => a - b
|
|
7
|
+
: (a, b) => b - a;
|
|
8
|
+
const levels = Array.from(groups.keys()).sort(comparator);
|
|
9
|
+
return levels;
|
|
10
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/core",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.13",
|
|
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.
|
|
42
|
+
"@nestjs/common": "11.0.13"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@nestjs/common": "^11.0.0",
|