assemblerjs 1.1.24 → 1.1.25
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.
- package/dist/index.d.ts +118 -0
- package/dist/index.js +15 -13
- package/dist/index.mjs +14 -13
- package/dist/index11.js +3 -3
- package/dist/index11.mjs +3 -3
- package/dist/index12.js +2 -2
- package/dist/index12.mjs +2 -2
- package/dist/index13.js +1 -1
- package/dist/index13.mjs +1 -1
- package/dist/index14.js +144 -3
- package/dist/index14.mjs +144 -3
- package/dist/index15.js +4 -22
- package/dist/index15.mjs +4 -22
- package/dist/index16.js +20 -9
- package/dist/index16.mjs +20 -9
- package/dist/index17.js +9 -87
- package/dist/index17.mjs +9 -87
- package/dist/index18.js +88 -16
- package/dist/index18.mjs +88 -16
- package/dist/index19.js +10 -10
- package/dist/index19.mjs +10 -10
- package/dist/index2.js +3 -3
- package/dist/index2.mjs +3 -3
- package/dist/index20.js +10 -10
- package/dist/index20.mjs +10 -10
- package/dist/index21.js +10 -10
- package/dist/index21.mjs +10 -10
- package/dist/index22.js +11 -26
- package/dist/index22.mjs +11 -25
- package/dist/index23.js +22 -22
- package/dist/index23.mjs +21 -21
- package/dist/index24.js +25 -19
- package/dist/index24.mjs +24 -19
- package/dist/index25.js +23 -25
- package/dist/index25.mjs +23 -21
- package/dist/index26.js +26 -46
- package/dist/index26.mjs +22 -45
- package/dist/index27.js +50 -2
- package/dist/index27.mjs +47 -2
- package/dist/index28.js +2 -19
- package/dist/index28.mjs +2 -15
- package/dist/index29.js +17 -159
- package/dist/index29.mjs +15 -158
- package/dist/index3.js +2 -2
- package/dist/index3.mjs +2 -2
- package/dist/index30.js +34 -44
- package/dist/index30.mjs +33 -44
- package/dist/index31.js +145 -66
- package/dist/index31.mjs +145 -67
- package/dist/index32.js +45 -50
- package/dist/index32.mjs +45 -50
- package/dist/index33.js +76 -28
- package/dist/index33.mjs +76 -28
- package/dist/index34.js +50 -170
- package/dist/index34.mjs +50 -170
- package/dist/index35.js +28 -60
- package/dist/index35.mjs +28 -60
- package/dist/index36.js +174 -16
- package/dist/index36.mjs +174 -13
- package/dist/index37.js +57 -16
- package/dist/index37.mjs +57 -16
- package/dist/index38.js +13 -103
- package/dist/index38.mjs +10 -101
- package/dist/index39.js +20 -38
- package/dist/index39.mjs +20 -37
- package/dist/index4.js +7 -7
- package/dist/index4.mjs +7 -7
- package/dist/index40.js +101 -117
- package/dist/index40.mjs +99 -117
- package/dist/index45.js +6 -6
- package/dist/index45.mjs +6 -6
- package/dist/index49.js +1 -1
- package/dist/index49.mjs +1 -1
- package/dist/index50.js +2 -2
- package/dist/index50.mjs +2 -2
- package/dist/index51.js +2 -2
- package/dist/index51.mjs +2 -2
- package/package.json +1 -1
package/dist/index37.mjs
CHANGED
|
@@ -1,24 +1,65 @@
|
|
|
1
|
-
class
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
let AbstractCycleDetector = class AbstractCycleDetector {
|
|
2
|
+
};
|
|
3
|
+
let NoOpCycleDetector = class NoOpCycleDetector extends AbstractCycleDetector {
|
|
4
|
+
detect() {
|
|
5
|
+
return [];
|
|
4
6
|
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
};
|
|
8
|
+
let ActiveCycleDetector = class ActiveCycleDetector extends AbstractCycleDetector {
|
|
9
|
+
detect(e, t) {
|
|
10
|
+
const c = [];
|
|
11
|
+
const s = new Set();
|
|
12
|
+
for (const [n] of e){
|
|
13
|
+
if (s.has(n)) continue;
|
|
14
|
+
const r = [];
|
|
15
|
+
const o = new Set();
|
|
16
|
+
if (this.hasCycleDFS(n, r, o, s, e)) {
|
|
17
|
+
const e = r.findIndex((e)=>e === n);
|
|
18
|
+
if (e >= 0) {
|
|
19
|
+
const s = r.slice(e).map((e)=>t(e));
|
|
20
|
+
c.push({
|
|
21
|
+
cycle: s,
|
|
22
|
+
path: s.join(' → ')
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
9
26
|
}
|
|
10
|
-
return
|
|
27
|
+
return c;
|
|
11
28
|
}
|
|
12
|
-
|
|
13
|
-
|
|
29
|
+
hasCycleDFS(e, t, c, s, n) {
|
|
30
|
+
if (c.has(e)) {
|
|
31
|
+
t.push(e);
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
if (s.has(e)) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
t.push(e);
|
|
38
|
+
c.add(e);
|
|
39
|
+
const r = n.get(e);
|
|
40
|
+
if (r?.dependencies && r.dependencies.length > 0) {
|
|
41
|
+
for (const e of r.dependencies){
|
|
42
|
+
if (this.hasCycleDFS(e, t, c, s, n)) {
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
c.delete(e);
|
|
48
|
+
s.add(e);
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
class CycleDetector {
|
|
53
|
+
static getInstance() {
|
|
54
|
+
return CycleDetector.instance;
|
|
14
55
|
}
|
|
15
|
-
static
|
|
16
|
-
|
|
56
|
+
static enable() {
|
|
57
|
+
CycleDetector.instance = new ActiveCycleDetector();
|
|
17
58
|
}
|
|
18
|
-
static
|
|
19
|
-
|
|
59
|
+
static disable() {
|
|
60
|
+
CycleDetector.instance = new NoOpCycleDetector();
|
|
20
61
|
}
|
|
21
62
|
}
|
|
22
|
-
|
|
63
|
+
CycleDetector.instance = new NoOpCycleDetector();
|
|
23
64
|
|
|
24
|
-
export {
|
|
65
|
+
export { CycleDetector };
|
package/dist/index38.js
CHANGED
|
@@ -2,112 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const constants = require('./
|
|
6
|
-
const reflection = require('./index36.js');
|
|
7
|
-
const helpers = require('./index3.js');
|
|
5
|
+
const constants = require('./index29.js');
|
|
8
6
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
test: (r)=>typeof r === 'boolean' || typeof r === 'undefined',
|
|
12
|
-
throw: ()=>{
|
|
13
|
-
throw new Error(`'singleton' property must be of type 'boolean' or 'undefined'.`);
|
|
14
|
-
},
|
|
15
|
-
transform: (r)=>{
|
|
16
|
-
return typeof r === 'undefined' ? true : r ? true : false;
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
events: {
|
|
20
|
-
test: (r)=>typeof r === 'undefined' || Array.isArray(r) && r.every((r)=>typeof r === 'string'),
|
|
21
|
-
throw: ()=>{
|
|
22
|
-
throw new Error(`'events' property must be an array of strings or 'undefined'.`);
|
|
23
|
-
},
|
|
24
|
-
transform: (r)=>r
|
|
25
|
-
},
|
|
26
|
-
inject: {
|
|
27
|
-
test: (r)=>typeof r === 'undefined' || Array.isArray(r) && r.every((r)=>Array.isArray(r) && r.length >= 1 && r.length <= 3),
|
|
28
|
-
throw: ()=>{
|
|
29
|
-
throw new Error(`'inject' property must be an array of tuples of length 1, 2 or 3.`);
|
|
30
|
-
},
|
|
31
|
-
transform: (r)=>r
|
|
32
|
-
},
|
|
33
|
-
use: {
|
|
34
|
-
test: (r)=>typeof r === 'undefined' || Array.isArray(r) && r.every((r)=>{
|
|
35
|
-
if (!Array.isArray(r) || r.length !== 2) {
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
const e = r[1];
|
|
39
|
-
return typeof e !== 'undefined';
|
|
40
|
-
}),
|
|
41
|
-
throw: ()=>{
|
|
42
|
-
throw new Error(`'use' property must be an array of tuples of length 2 with [identifier, instance | factory].`);
|
|
43
|
-
},
|
|
44
|
-
transform: (r)=>r
|
|
45
|
-
},
|
|
46
|
-
engage: {
|
|
47
|
-
test: (r)=>typeof r === 'undefined' || Array.isArray(r) && r.every((r)=>Array.isArray(r) && r.length >= 1 && r.length <= 3),
|
|
48
|
-
throw: ()=>{
|
|
49
|
-
throw new Error(`'engage' property must be an array of tuples of length 1, 2 or 3.`);
|
|
50
|
-
},
|
|
51
|
-
transform: (r)=>r
|
|
52
|
-
},
|
|
53
|
-
tags: {
|
|
54
|
-
test: (r)=>typeof r === 'undefined' || typeof r === 'string' || Array.isArray(r) && r.every((r)=>typeof r === 'string'),
|
|
55
|
-
throw: ()=>{
|
|
56
|
-
throw new Error(`'tags' property must be a string or an array of strings.`);
|
|
57
|
-
},
|
|
58
|
-
transform: (r)=>typeof r === 'string' ? [
|
|
59
|
-
r
|
|
60
|
-
] : r
|
|
61
|
-
},
|
|
62
|
-
metadata: {
|
|
63
|
-
test: (r)=>(typeof r === 'object' || typeof r === 'undefined') && !Array.isArray(r),
|
|
64
|
-
throw: ()=>{
|
|
65
|
-
throw new Error(`'metadata' property must be of type 'object' or 'undefined'.`);
|
|
66
|
-
},
|
|
67
|
-
transform: (r)=>r
|
|
68
|
-
},
|
|
69
|
-
global: {
|
|
70
|
-
test: (r)=>(typeof r === 'object' || typeof r === 'undefined') && !Array.isArray(r),
|
|
71
|
-
throw: ()=>{
|
|
72
|
-
throw new Error(`'global' property must be of type 'object' or 'undefined'.`);
|
|
73
|
-
},
|
|
74
|
-
transform: (r)=>r
|
|
75
|
-
}
|
|
7
|
+
const defineCustomMetadata = (t, o, n)=>{
|
|
8
|
+
Reflect.defineMetadata(`${constants.ReflectPrefix}${t}${constants.ReflectSuffix}`, o, n);
|
|
76
9
|
};
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
...r
|
|
80
|
-
};
|
|
81
|
-
for(const r in e){
|
|
82
|
-
if (!Object.keys(n).includes(r)) {
|
|
83
|
-
throw new Error(`Property '${r}' is not a valid assemblage definition property.`);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
for(const r in n){
|
|
87
|
-
const t = n[r].test;
|
|
88
|
-
const o = n[r].throw;
|
|
89
|
-
const s = n[r].transform;
|
|
90
|
-
if (!t(e[r])) {
|
|
91
|
-
o();
|
|
92
|
-
}
|
|
93
|
-
e[r] = s(e[r]);
|
|
94
|
-
}
|
|
95
|
-
return e;
|
|
10
|
+
const getCustomMetadata = (t, o)=>{
|
|
11
|
+
return Reflect.getMetadata(`${constants.ReflectPrefix}${t}${constants.ReflectSuffix}`, o);
|
|
96
12
|
};
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
throw new Error(`Class '${e.name}' is not an assemblage or transversal.`);
|
|
100
|
-
}
|
|
101
|
-
return reflection.getOwnCustomMetadata(constants.ReflectValue.AssemblageDefinition, e);
|
|
13
|
+
const getOwnCustomMetadata = (t, o)=>{
|
|
14
|
+
return Reflect.getOwnMetadata(`${constants.ReflectPrefix}${t}${constants.ReflectSuffix}`, o);
|
|
102
15
|
};
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
s[t] = o;
|
|
106
|
-
const a = validateDefinition(s);
|
|
107
|
-
reflection.defineCustomMetadata(constants.ReflectValue.AssemblageDefinition, a, n);
|
|
108
|
-
return a;
|
|
16
|
+
const getParamTypes = (e)=>{
|
|
17
|
+
return Reflect.getMetadata(constants.ReflectParamTypes, e) || [];
|
|
109
18
|
};
|
|
110
19
|
|
|
111
|
-
exports.
|
|
112
|
-
exports.
|
|
113
|
-
exports.
|
|
20
|
+
exports.defineCustomMetadata = defineCustomMetadata;
|
|
21
|
+
exports.getCustomMetadata = getCustomMetadata;
|
|
22
|
+
exports.getOwnCustomMetadata = getOwnCustomMetadata;
|
|
23
|
+
exports.getParamTypes = getParamTypes;
|
package/dist/index38.mjs
CHANGED
|
@@ -1,107 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getOwnCustomMetadata, defineCustomMetadata } from './index36.mjs';
|
|
3
|
-
import { isAssemblage } from './index3.mjs';
|
|
1
|
+
import { ReflectPrefix, ReflectSuffix, ReflectParamTypes } from './index29.mjs';
|
|
4
2
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
test: (r)=>typeof r === 'boolean' || typeof r === 'undefined',
|
|
8
|
-
throw: ()=>{
|
|
9
|
-
throw new Error(`'singleton' property must be of type 'boolean' or 'undefined'.`);
|
|
10
|
-
},
|
|
11
|
-
transform: (r)=>{
|
|
12
|
-
return typeof r === 'undefined' ? true : r ? true : false;
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
events: {
|
|
16
|
-
test: (r)=>typeof r === 'undefined' || Array.isArray(r) && r.every((r)=>typeof r === 'string'),
|
|
17
|
-
throw: ()=>{
|
|
18
|
-
throw new Error(`'events' property must be an array of strings or 'undefined'.`);
|
|
19
|
-
},
|
|
20
|
-
transform: (r)=>r
|
|
21
|
-
},
|
|
22
|
-
inject: {
|
|
23
|
-
test: (r)=>typeof r === 'undefined' || Array.isArray(r) && r.every((r)=>Array.isArray(r) && r.length >= 1 && r.length <= 3),
|
|
24
|
-
throw: ()=>{
|
|
25
|
-
throw new Error(`'inject' property must be an array of tuples of length 1, 2 or 3.`);
|
|
26
|
-
},
|
|
27
|
-
transform: (r)=>r
|
|
28
|
-
},
|
|
29
|
-
use: {
|
|
30
|
-
test: (r)=>typeof r === 'undefined' || Array.isArray(r) && r.every((r)=>{
|
|
31
|
-
if (!Array.isArray(r) || r.length !== 2) {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
const e = r[1];
|
|
35
|
-
return typeof e !== 'undefined';
|
|
36
|
-
}),
|
|
37
|
-
throw: ()=>{
|
|
38
|
-
throw new Error(`'use' property must be an array of tuples of length 2 with [identifier, instance | factory].`);
|
|
39
|
-
},
|
|
40
|
-
transform: (r)=>r
|
|
41
|
-
},
|
|
42
|
-
engage: {
|
|
43
|
-
test: (r)=>typeof r === 'undefined' || Array.isArray(r) && r.every((r)=>Array.isArray(r) && r.length >= 1 && r.length <= 3),
|
|
44
|
-
throw: ()=>{
|
|
45
|
-
throw new Error(`'engage' property must be an array of tuples of length 1, 2 or 3.`);
|
|
46
|
-
},
|
|
47
|
-
transform: (r)=>r
|
|
48
|
-
},
|
|
49
|
-
tags: {
|
|
50
|
-
test: (r)=>typeof r === 'undefined' || typeof r === 'string' || Array.isArray(r) && r.every((r)=>typeof r === 'string'),
|
|
51
|
-
throw: ()=>{
|
|
52
|
-
throw new Error(`'tags' property must be a string or an array of strings.`);
|
|
53
|
-
},
|
|
54
|
-
transform: (r)=>typeof r === 'string' ? [
|
|
55
|
-
r
|
|
56
|
-
] : r
|
|
57
|
-
},
|
|
58
|
-
metadata: {
|
|
59
|
-
test: (r)=>(typeof r === 'object' || typeof r === 'undefined') && !Array.isArray(r),
|
|
60
|
-
throw: ()=>{
|
|
61
|
-
throw new Error(`'metadata' property must be of type 'object' or 'undefined'.`);
|
|
62
|
-
},
|
|
63
|
-
transform: (r)=>r
|
|
64
|
-
},
|
|
65
|
-
global: {
|
|
66
|
-
test: (r)=>(typeof r === 'object' || typeof r === 'undefined') && !Array.isArray(r),
|
|
67
|
-
throw: ()=>{
|
|
68
|
-
throw new Error(`'global' property must be of type 'object' or 'undefined'.`);
|
|
69
|
-
},
|
|
70
|
-
transform: (r)=>r
|
|
71
|
-
}
|
|
3
|
+
const defineCustomMetadata = (t, o, n)=>{
|
|
4
|
+
Reflect.defineMetadata(`${ReflectPrefix}${t}${ReflectSuffix}`, o, n);
|
|
72
5
|
};
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
...r
|
|
76
|
-
};
|
|
77
|
-
for(const r in e){
|
|
78
|
-
if (!Object.keys(n).includes(r)) {
|
|
79
|
-
throw new Error(`Property '${r}' is not a valid assemblage definition property.`);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
for(const r in n){
|
|
83
|
-
const t = n[r].test;
|
|
84
|
-
const o = n[r].throw;
|
|
85
|
-
const s = n[r].transform;
|
|
86
|
-
if (!t(e[r])) {
|
|
87
|
-
o();
|
|
88
|
-
}
|
|
89
|
-
e[r] = s(e[r]);
|
|
90
|
-
}
|
|
91
|
-
return e;
|
|
6
|
+
const getCustomMetadata = (t, o)=>{
|
|
7
|
+
return Reflect.getMetadata(`${ReflectPrefix}${t}${ReflectSuffix}`, o);
|
|
92
8
|
};
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
throw new Error(`Class '${e.name}' is not an assemblage or transversal.`);
|
|
96
|
-
}
|
|
97
|
-
return getOwnCustomMetadata(ReflectValue.AssemblageDefinition, e);
|
|
9
|
+
const getOwnCustomMetadata = (t, o)=>{
|
|
10
|
+
return Reflect.getOwnMetadata(`${ReflectPrefix}${t}${ReflectSuffix}`, o);
|
|
98
11
|
};
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
s[t] = o;
|
|
102
|
-
const a = validateDefinition(s);
|
|
103
|
-
defineCustomMetadata(ReflectValue.AssemblageDefinition, a, n);
|
|
104
|
-
return a;
|
|
12
|
+
const getParamTypes = (e)=>{
|
|
13
|
+
return Reflect.getMetadata(ReflectParamTypes, e) || [];
|
|
105
14
|
};
|
|
106
15
|
|
|
107
|
-
export {
|
|
16
|
+
export { defineCustomMetadata, getCustomMetadata, getOwnCustomMetadata, getParamTypes };
|
package/dist/index39.js
CHANGED
|
@@ -2,45 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const o = t.concrete !== undefined && t.concrete.prototype instanceof eventManager.EventManager;
|
|
9
|
-
if (o) {
|
|
10
|
-
const e = n;
|
|
11
|
-
const o = e.channels;
|
|
12
|
-
for (const n of t.events){
|
|
13
|
-
if (!o.has(n)) e.addChannels(n);
|
|
14
|
-
if (!t.privateContext.events.has(n)) t.privateContext.addChannels(n);
|
|
15
|
-
}
|
|
16
|
-
for (const e of t.events){
|
|
17
|
-
n.on(e, (...n)=>{
|
|
18
|
-
t.privateContext.emit(e, ...n);
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
} else {
|
|
22
|
-
for (const e of t.events){
|
|
23
|
-
if (!t.privateContext.events.has(e)) t.privateContext.addChannels(e);
|
|
24
|
-
}
|
|
5
|
+
class ResolverStore {
|
|
6
|
+
static register(e, r) {
|
|
7
|
+
this.resolvers.set(e, r);
|
|
25
8
|
}
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const e = n;
|
|
31
|
-
for (const n of t.events){
|
|
32
|
-
e.off(n);
|
|
33
|
-
}
|
|
34
|
-
e.removeChannels(...t.events);
|
|
35
|
-
t.privateContext.removeChannels(...t.events);
|
|
36
|
-
} else {
|
|
37
|
-
for (const e of t.events){
|
|
38
|
-
if (t.privateContext.events.has(e)) {
|
|
39
|
-
t.privateContext.removeChannels(e);
|
|
40
|
-
}
|
|
9
|
+
static getResolver(e) {
|
|
10
|
+
const r = this.resolvers.get(e);
|
|
11
|
+
if (!r) {
|
|
12
|
+
throw new Error(`No resolver found for decorator type: ${e}`);
|
|
41
13
|
}
|
|
14
|
+
return new r();
|
|
15
|
+
}
|
|
16
|
+
static hasResolver(e) {
|
|
17
|
+
return this.resolvers.has(e);
|
|
18
|
+
}
|
|
19
|
+
static getRegisteredTypes() {
|
|
20
|
+
return Array.from(this.resolvers.keys());
|
|
21
|
+
}
|
|
22
|
+
static clear() {
|
|
23
|
+
this.resolvers.clear();
|
|
42
24
|
}
|
|
43
|
-
}
|
|
25
|
+
}
|
|
26
|
+
ResolverStore.resolvers = new Map();
|
|
44
27
|
|
|
45
|
-
exports.
|
|
46
|
-
exports.unregisterEvents = unregisterEvents;
|
|
28
|
+
exports.ResolverStore = ResolverStore;
|
package/dist/index39.mjs
CHANGED
|
@@ -1,41 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const o = t.concrete !== undefined && t.concrete.prototype instanceof EventManager;
|
|
5
|
-
if (o) {
|
|
6
|
-
const e = n;
|
|
7
|
-
const o = e.channels;
|
|
8
|
-
for (const n of t.events){
|
|
9
|
-
if (!o.has(n)) e.addChannels(n);
|
|
10
|
-
if (!t.privateContext.events.has(n)) t.privateContext.addChannels(n);
|
|
11
|
-
}
|
|
12
|
-
for (const e of t.events){
|
|
13
|
-
n.on(e, (...n)=>{
|
|
14
|
-
t.privateContext.emit(e, ...n);
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
} else {
|
|
18
|
-
for (const e of t.events){
|
|
19
|
-
if (!t.privateContext.events.has(e)) t.privateContext.addChannels(e);
|
|
20
|
-
}
|
|
1
|
+
class ResolverStore {
|
|
2
|
+
static register(e, r) {
|
|
3
|
+
this.resolvers.set(e, r);
|
|
21
4
|
}
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const e = n;
|
|
27
|
-
for (const n of t.events){
|
|
28
|
-
e.off(n);
|
|
29
|
-
}
|
|
30
|
-
e.removeChannels(...t.events);
|
|
31
|
-
t.privateContext.removeChannels(...t.events);
|
|
32
|
-
} else {
|
|
33
|
-
for (const e of t.events){
|
|
34
|
-
if (t.privateContext.events.has(e)) {
|
|
35
|
-
t.privateContext.removeChannels(e);
|
|
36
|
-
}
|
|
5
|
+
static getResolver(e) {
|
|
6
|
+
const r = this.resolvers.get(e);
|
|
7
|
+
if (!r) {
|
|
8
|
+
throw new Error(`No resolver found for decorator type: ${e}`);
|
|
37
9
|
}
|
|
10
|
+
return new r();
|
|
11
|
+
}
|
|
12
|
+
static hasResolver(e) {
|
|
13
|
+
return this.resolvers.has(e);
|
|
14
|
+
}
|
|
15
|
+
static getRegisteredTypes() {
|
|
16
|
+
return Array.from(this.resolvers.keys());
|
|
17
|
+
}
|
|
18
|
+
static clear() {
|
|
19
|
+
this.resolvers.clear();
|
|
38
20
|
}
|
|
39
|
-
}
|
|
21
|
+
}
|
|
22
|
+
ResolverStore.resolvers = new Map();
|
|
40
23
|
|
|
41
|
-
export {
|
|
24
|
+
export { ResolverStore };
|
package/dist/index4.js
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
5
|
const core = require('@assemblerjs/core');
|
|
6
|
-
const injectableManager = require('./
|
|
7
|
-
const objectManager = require('./
|
|
8
|
-
const hookManager = require('./
|
|
9
|
-
const assemblerBuilder = require('./
|
|
10
|
-
const contextProvider = require('./
|
|
11
|
-
const debugLogger = require('./
|
|
12
|
-
const cycleDetector = require('./
|
|
6
|
+
const injectableManager = require('./index31.js');
|
|
7
|
+
const objectManager = require('./index32.js');
|
|
8
|
+
const hookManager = require('./index33.js');
|
|
9
|
+
const assemblerBuilder = require('./index34.js');
|
|
10
|
+
const contextProvider = require('./index35.js');
|
|
11
|
+
const debugLogger = require('./index36.js');
|
|
12
|
+
const cycleDetector = require('./index37.js');
|
|
13
13
|
const eventManager = require('./index6.js');
|
|
14
14
|
|
|
15
15
|
class Assembler extends eventManager.EventManager {
|
package/dist/index4.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { clearInstance } from '@assemblerjs/core';
|
|
2
|
-
import { InjectableManager } from './
|
|
3
|
-
import { ObjectManager } from './
|
|
4
|
-
import { HookManager } from './
|
|
5
|
-
import { AssemblerBuilder } from './
|
|
6
|
-
import { ContextProvider } from './
|
|
7
|
-
import { DebugLogger } from './
|
|
8
|
-
import { CycleDetector } from './
|
|
2
|
+
import { InjectableManager } from './index31.mjs';
|
|
3
|
+
import { ObjectManager } from './index32.mjs';
|
|
4
|
+
import { HookManager } from './index33.mjs';
|
|
5
|
+
import { AssemblerBuilder } from './index34.mjs';
|
|
6
|
+
import { ContextProvider } from './index35.mjs';
|
|
7
|
+
import { DebugLogger } from './index36.mjs';
|
|
8
|
+
import { CycleDetector } from './index37.mjs';
|
|
9
9
|
import { EventManager } from './index6.mjs';
|
|
10
10
|
|
|
11
11
|
class Assembler extends EventManager {
|