1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const iterare_1 = require("iterare");
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | function getTransientInstances(instances) {
|
9 | return iterare_1.default(instances)
|
10 | .filter(([_, wrapper]) => wrapper.isDependencyTreeStatic())
|
11 | .map(([_, wrapper]) => wrapper.getStaticTransientInstances())
|
12 | .flatten()
|
13 | .filter(item => !!item)
|
14 | .map(({ instance }) => instance)
|
15 | .toArray();
|
16 | }
|
17 | exports.getTransientInstances = getTransientInstances;
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | function getNonTransientInstances(instances) {
|
23 | return iterare_1.default(instances)
|
24 | .filter(([key, wrapper]) => wrapper.isDependencyTreeStatic() && !wrapper.isTransient)
|
25 | .map(([key, { instance }]) => instance)
|
26 | .toArray();
|
27 | }
|
28 | exports.getNonTransientInstances = getNonTransientInstances;
|