assemblerjs 1.1.21 → 1.1.22
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/index11.js +2 -2
- package/dist/index11.mjs +2 -2
- package/dist/index13.js +1 -1
- package/dist/index13.mjs +1 -1
- package/dist/index16.js +1 -1
- package/dist/index16.mjs +1 -1
- package/dist/index17.js +1 -1
- package/dist/index17.mjs +1 -1
- package/dist/index18.js +1 -1
- package/dist/index18.mjs +1 -1
- package/dist/index19.js +1 -1
- package/dist/index19.mjs +1 -1
- package/dist/index2.js +2 -2
- package/dist/index2.mjs +2 -2
- package/dist/index20.js +1 -1
- package/dist/index20.mjs +1 -1
- package/dist/index21.js +1 -1
- package/dist/index21.mjs +1 -1
- package/dist/index22.js +3 -3
- package/dist/index22.mjs +3 -3
- package/dist/index23.js +3 -3
- package/dist/index23.mjs +3 -3
- package/dist/index24.js +2 -2
- package/dist/index24.mjs +2 -2
- package/dist/index25.js +1 -1
- package/dist/index25.mjs +1 -1
- package/dist/index26.js +1 -1
- package/dist/index26.mjs +1 -1
- package/dist/index29.js +158 -17
- package/dist/index29.mjs +157 -14
- package/dist/index3.js +1 -1
- package/dist/index3.mjs +1 -1
- package/dist/index30.js +43 -100
- package/dist/index30.mjs +43 -98
- package/dist/index31.js +71 -32
- package/dist/index31.mjs +71 -31
- package/dist/index32.js +51 -154
- package/dist/index32.mjs +51 -153
- package/dist/index33.js +28 -47
- package/dist/index33.mjs +28 -47
- package/dist/index34.js +161 -65
- package/dist/index34.mjs +161 -65
- package/dist/index35.js +58 -50
- package/dist/index35.mjs +58 -50
- package/dist/index36.js +18 -32
- package/dist/index36.mjs +15 -32
- package/dist/index37.js +99 -167
- package/dist/index37.mjs +97 -167
- package/dist/index38.js +16 -57
- package/dist/index38.mjs +16 -57
- package/dist/index39.js +38 -20
- package/dist/index39.mjs +37 -20
- package/dist/index4.js +7 -7
- package/dist/index4.mjs +7 -7
- package/dist/index42.js +29 -49
- package/dist/index42.mjs +28 -49
- package/dist/index44.js +49 -29
- package/dist/index44.mjs +49 -28
- package/dist/index45.js +25 -9
- package/dist/index45.mjs +25 -9
- package/dist/index49.js +1 -1
- package/dist/index49.mjs +1 -1
- package/dist/index50.js +1 -1
- package/dist/index50.mjs +1 -1
- package/dist/index51.js +1 -1
- package/dist/index51.mjs +1 -1
- package/package.json +1 -1
package/dist/index37.mjs
CHANGED
|
@@ -1,177 +1,107 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (o && o !== 'Object') {
|
|
14
|
-
return o;
|
|
15
|
-
}
|
|
16
|
-
if (e.name && typeof e.name === 'string') {
|
|
17
|
-
return e.name;
|
|
1
|
+
import { ReflectValue } from './index28.mjs';
|
|
2
|
+
import { getOwnCustomMetadata, defineCustomMetadata } from './index36.mjs';
|
|
3
|
+
import { isAssemblage } from './index3.mjs';
|
|
4
|
+
|
|
5
|
+
const n = {
|
|
6
|
+
singleton: {
|
|
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;
|
|
18
13
|
}
|
|
19
|
-
|
|
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
|
|
20
71
|
}
|
|
21
|
-
return String(e);
|
|
22
|
-
}
|
|
23
|
-
let NoOpDebugLogger = class NoOpDebugLogger {
|
|
24
|
-
configure(e) {}
|
|
25
|
-
log(e, o, t) {}
|
|
26
|
-
logBuildStart(e) {}
|
|
27
|
-
logBuildEnd(e, o) {}
|
|
28
|
-
logRegistration(e) {}
|
|
29
|
-
logHook(e, o, t) {}
|
|
30
|
-
logPhaseStart(e, o) {}
|
|
31
|
-
logPhaseEnd(e, o, t) {}
|
|
32
|
-
logResolution(e, o, t) {}
|
|
33
|
-
logConstruction(e) {}
|
|
34
|
-
logInjection(e, o) {}
|
|
35
72
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
...e.logPhases || {}
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
logBuildStart(e) {
|
|
48
|
-
this.log('info', 'Build started', {
|
|
49
|
-
entry: e.name
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
logBuildEnd(e, o) {
|
|
53
|
-
const t = {
|
|
54
|
-
entry: e.name
|
|
55
|
-
};
|
|
56
|
-
if (o !== undefined) t.duration = `${o.toFixed(2)}ms`;
|
|
57
|
-
this.log('info', 'Build completed', t);
|
|
58
|
-
}
|
|
59
|
-
logRegistration(o) {
|
|
60
|
-
if (!this.shouldLog('registration')) return;
|
|
61
|
-
this.log('info', 'Registration', {
|
|
62
|
-
identifier: e(o.identifier),
|
|
63
|
-
isSingleton: o.isSingleton,
|
|
64
|
-
dependencies: o.dependencies.map((o)=>e(o)),
|
|
65
|
-
tags: o.tags
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
logHook(o, t, n) {
|
|
69
|
-
if (!this.shouldLog('hooks')) return;
|
|
70
|
-
const i = this.options.logTimings ? performance.now() : 0;
|
|
71
|
-
this.log('info', `Hook: ${o}`, {
|
|
72
|
-
target: e(t),
|
|
73
|
-
config: n
|
|
74
|
-
});
|
|
75
|
-
if (this.options.logTimings) {
|
|
76
|
-
return ()=>{
|
|
77
|
-
const e = performance.now() - i;
|
|
78
|
-
this.log('info', `Hook: ${o} completed`, {
|
|
79
|
-
duration: `${e.toFixed(2)}ms`
|
|
80
|
-
});
|
|
81
|
-
};
|
|
73
|
+
const validateDefinition = (r)=>{
|
|
74
|
+
const e = {
|
|
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.`);
|
|
82
80
|
}
|
|
83
81
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
} : {};
|
|
91
|
-
if (t) {
|
|
92
|
-
Object.assign(n, t);
|
|
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();
|
|
93
88
|
}
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
logResolution(e, o, t) {
|
|
97
|
-
if (!this.shouldLog('resolution')) return;
|
|
98
|
-
this.log('info', `Resolving: ${e}`, {
|
|
99
|
-
strategy: `${o} strategy`,
|
|
100
|
-
cache: t ? 'hit' : 'miss'
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
logConstruction(e) {
|
|
104
|
-
if (!this.shouldLog('construction')) return;
|
|
105
|
-
this.log('info', `Constructing: ${e}`);
|
|
106
|
-
}
|
|
107
|
-
logInjection(e, o) {
|
|
108
|
-
if (!this.shouldLog(e === 'use' ? 'injectionUse' : 'injectionGlobal')) return;
|
|
109
|
-
this.log('info', `Injecting: @${e === 'use' ? 'Use' : 'Global'}`, o);
|
|
110
|
-
}
|
|
111
|
-
shouldLog(e) {
|
|
112
|
-
return !this.options.logPhases || this.options.logPhases[e] !== false;
|
|
113
|
-
}
|
|
114
|
-
log(e, o, t) {
|
|
115
|
-
if (this.options.logger) {
|
|
116
|
-
this.options.logger(e, o, t);
|
|
117
|
-
} else {
|
|
118
|
-
const n = `[Assembler:${e}]`;
|
|
119
|
-
const i = this.options.useColors !== false ? this.colorize(e, n) : n;
|
|
120
|
-
if (t) {
|
|
121
|
-
console.log(`${i} ${o}`, t);
|
|
122
|
-
} else {
|
|
123
|
-
console.log(`${i} ${o}`);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
colorize(e, o) {
|
|
128
|
-
const t = {
|
|
129
|
-
info: '\x1b[36m',
|
|
130
|
-
warn: '\x1b[33m',
|
|
131
|
-
error: '\x1b[31m',
|
|
132
|
-
reset: '\x1b[0m'
|
|
133
|
-
};
|
|
134
|
-
const n = t[e] || t.info;
|
|
135
|
-
return `${n}${o}${t.reset}`;
|
|
136
|
-
}
|
|
137
|
-
constructor(){
|
|
138
|
-
this.options = {
|
|
139
|
-
enabled: true,
|
|
140
|
-
logPhases: {
|
|
141
|
-
registration: true,
|
|
142
|
-
registrationUse: true,
|
|
143
|
-
registrationGlobals: true,
|
|
144
|
-
resolution: true,
|
|
145
|
-
construction: true,
|
|
146
|
-
hooks: true,
|
|
147
|
-
cache: true,
|
|
148
|
-
injectionUse: true,
|
|
149
|
-
injectionGlobal: true
|
|
150
|
-
},
|
|
151
|
-
logTimings: false,
|
|
152
|
-
logDependencyTree: true,
|
|
153
|
-
useColors: true
|
|
154
|
-
};
|
|
89
|
+
e[r] = s(e[r]);
|
|
155
90
|
}
|
|
91
|
+
return e;
|
|
156
92
|
};
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
93
|
+
const getDefinition = (e)=>{
|
|
94
|
+
if (!isAssemblage(e)) {
|
|
95
|
+
throw new Error(`Class '${e.name}' is not an assemblage or transversal.`);
|
|
160
96
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
static disable() {
|
|
172
|
-
DebugLogger.instance = new NoOpDebugLogger();
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
DebugLogger.instance = new NoOpDebugLogger();
|
|
97
|
+
return getOwnCustomMetadata(ReflectValue.AssemblageDefinition, e);
|
|
98
|
+
};
|
|
99
|
+
const setDefinitionValue = (t, o, n)=>{
|
|
100
|
+
const s = getDefinition(n);
|
|
101
|
+
s[t] = o;
|
|
102
|
+
const a = validateDefinition(s);
|
|
103
|
+
defineCustomMetadata(ReflectValue.AssemblageDefinition, a, n);
|
|
104
|
+
return a;
|
|
105
|
+
};
|
|
176
106
|
|
|
177
|
-
export {
|
|
107
|
+
export { getDefinition, setDefinitionValue, validateDefinition };
|
package/dist/index38.js
CHANGED
|
@@ -2,68 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
detect() {
|
|
9
|
-
return [];
|
|
5
|
+
class ResolverStore {
|
|
6
|
+
static register(e, r) {
|
|
7
|
+
this.resolvers.set(e, r);
|
|
10
8
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const s = new Set();
|
|
16
|
-
for (const [n] of e){
|
|
17
|
-
if (s.has(n)) continue;
|
|
18
|
-
const r = [];
|
|
19
|
-
const o = new Set();
|
|
20
|
-
if (this.hasCycleDFS(n, r, o, s, e)) {
|
|
21
|
-
const e = r.findIndex((e)=>e === n);
|
|
22
|
-
if (e >= 0) {
|
|
23
|
-
const s = r.slice(e).map((e)=>t(e));
|
|
24
|
-
c.push({
|
|
25
|
-
cycle: s,
|
|
26
|
-
path: s.join(' → ')
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
}
|
|
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}`);
|
|
30
13
|
}
|
|
31
|
-
return
|
|
14
|
+
return new r();
|
|
32
15
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
t.push(e);
|
|
36
|
-
return true;
|
|
37
|
-
}
|
|
38
|
-
if (s.has(e)) {
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
t.push(e);
|
|
42
|
-
c.add(e);
|
|
43
|
-
const r = n.get(e);
|
|
44
|
-
if (r?.dependencies && r.dependencies.length > 0) {
|
|
45
|
-
for (const e of r.dependencies){
|
|
46
|
-
if (this.hasCycleDFS(e, t, c, s, n)) {
|
|
47
|
-
return true;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
c.delete(e);
|
|
52
|
-
s.add(e);
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
class CycleDetector {
|
|
57
|
-
static getInstance() {
|
|
58
|
-
return CycleDetector.instance;
|
|
16
|
+
static hasResolver(e) {
|
|
17
|
+
return this.resolvers.has(e);
|
|
59
18
|
}
|
|
60
|
-
static
|
|
61
|
-
|
|
19
|
+
static getRegisteredTypes() {
|
|
20
|
+
return Array.from(this.resolvers.keys());
|
|
62
21
|
}
|
|
63
|
-
static
|
|
64
|
-
|
|
22
|
+
static clear() {
|
|
23
|
+
this.resolvers.clear();
|
|
65
24
|
}
|
|
66
25
|
}
|
|
67
|
-
|
|
26
|
+
ResolverStore.resolvers = new Map();
|
|
68
27
|
|
|
69
|
-
exports.
|
|
28
|
+
exports.ResolverStore = ResolverStore;
|
package/dist/index38.mjs
CHANGED
|
@@ -1,65 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
detect() {
|
|
5
|
-
return [];
|
|
1
|
+
class ResolverStore {
|
|
2
|
+
static register(e, r) {
|
|
3
|
+
this.resolvers.set(e, r);
|
|
6
4
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
}
|
|
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}`);
|
|
26
9
|
}
|
|
27
|
-
return
|
|
10
|
+
return new r();
|
|
28
11
|
}
|
|
29
|
-
|
|
30
|
-
|
|
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;
|
|
12
|
+
static hasResolver(e) {
|
|
13
|
+
return this.resolvers.has(e);
|
|
55
14
|
}
|
|
56
|
-
static
|
|
57
|
-
|
|
15
|
+
static getRegisteredTypes() {
|
|
16
|
+
return Array.from(this.resolvers.keys());
|
|
58
17
|
}
|
|
59
|
-
static
|
|
60
|
-
|
|
18
|
+
static clear() {
|
|
19
|
+
this.resolvers.clear();
|
|
61
20
|
}
|
|
62
21
|
}
|
|
63
|
-
|
|
22
|
+
ResolverStore.resolvers = new Map();
|
|
64
23
|
|
|
65
|
-
export {
|
|
24
|
+
export { ResolverStore };
|
package/dist/index39.js
CHANGED
|
@@ -2,27 +2,45 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
const eventManager = require('./index6.js');
|
|
6
|
+
|
|
7
|
+
const registerEvents = (t, n)=>{
|
|
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);
|
|
13
24
|
}
|
|
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
25
|
}
|
|
22
|
-
|
|
23
|
-
|
|
26
|
+
};
|
|
27
|
+
const unregisterEvents = (t, n)=>{
|
|
28
|
+
const o = t.concrete !== undefined && t.concrete.prototype instanceof eventManager.EventManager;
|
|
29
|
+
if (o) {
|
|
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
|
+
}
|
|
41
|
+
}
|
|
24
42
|
}
|
|
25
|
-
}
|
|
26
|
-
ResolverStore.resolvers = new Map();
|
|
43
|
+
};
|
|
27
44
|
|
|
28
|
-
exports.
|
|
45
|
+
exports.registerEvents = registerEvents;
|
|
46
|
+
exports.unregisterEvents = unregisterEvents;
|
package/dist/index39.mjs
CHANGED
|
@@ -1,24 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { EventManager } from './index6.mjs';
|
|
2
|
+
|
|
3
|
+
const registerEvents = (t, n)=>{
|
|
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);
|
|
9
20
|
}
|
|
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
21
|
}
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
};
|
|
23
|
+
const unregisterEvents = (t, n)=>{
|
|
24
|
+
const o = t.concrete !== undefined && t.concrete.prototype instanceof EventManager;
|
|
25
|
+
if (o) {
|
|
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
|
+
}
|
|
37
|
+
}
|
|
20
38
|
}
|
|
21
|
-
}
|
|
22
|
-
ResolverStore.resolvers = new Map();
|
|
39
|
+
};
|
|
23
40
|
|
|
24
|
-
export {
|
|
41
|
+
export { registerEvents, unregisterEvents };
|
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('./index29.js');
|
|
7
|
+
const objectManager = require('./index30.js');
|
|
8
|
+
const hookManager = require('./index31.js');
|
|
9
|
+
const assemblerBuilder = require('./index32.js');
|
|
10
|
+
const contextProvider = require('./index33.js');
|
|
11
|
+
const debugLogger = require('./index34.js');
|
|
12
|
+
const cycleDetector = require('./index35.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 './index29.mjs';
|
|
3
|
+
import { ObjectManager } from './index30.mjs';
|
|
4
|
+
import { HookManager } from './index31.mjs';
|
|
5
|
+
import { AssemblerBuilder } from './index32.mjs';
|
|
6
|
+
import { ContextProvider } from './index33.mjs';
|
|
7
|
+
import { DebugLogger } from './index34.mjs';
|
|
8
|
+
import { CycleDetector } from './index35.mjs';
|
|
9
9
|
import { EventManager } from './index6.mjs';
|
|
10
10
|
|
|
11
11
|
class Assembler extends EventManager {
|