assemblerjs 1.1.23 → 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 +122 -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 +2 -2
- package/dist/index13.mjs +2 -2
- 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 +18 -101
- package/dist/index39.mjs +18 -101
- package/dist/index4.js +7 -7
- package/dist/index4.mjs +7 -7
- package/dist/index40.js +101 -22
- package/dist/index40.mjs +99 -22
- package/dist/index41.js +24 -36
- package/dist/index41.mjs +24 -35
- 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/index27.mjs
CHANGED
|
@@ -1,3 +1,48 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReflectParamTypes, ReflectValue } from './index29.mjs';
|
|
2
|
+
import { getOwnCustomMetadata, defineCustomMetadata } from './index38.mjs';
|
|
3
|
+
import { getDecoratedParametersIndexes, getParamValueKey, getParamIndexKey } from './index26.mjs';
|
|
4
|
+
import { ParameterDecoratorFactory } from './index18.mjs';
|
|
5
|
+
import { decorateAssemblage } from './index2.mjs';
|
|
2
6
|
|
|
3
|
-
|
|
7
|
+
const createConstructorDecorator = (e)=>{
|
|
8
|
+
return (t)=>ConstructorDecorator(e, t);
|
|
9
|
+
};
|
|
10
|
+
const ConstructorDecorator = (m, i)=>(l)=>{
|
|
11
|
+
const p = class extends l {
|
|
12
|
+
constructor(...e){
|
|
13
|
+
super(...e);
|
|
14
|
+
if (m) m.call(this, i);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(p, 'name', {
|
|
18
|
+
value: l.name
|
|
19
|
+
});
|
|
20
|
+
const u = Reflect.getOwnMetadata(ReflectParamTypes, l) || [];
|
|
21
|
+
const d = getDecoratedParametersIndexes(l);
|
|
22
|
+
const g = [];
|
|
23
|
+
const h = ParameterDecoratorFactory.getRegisteredDecorators();
|
|
24
|
+
for(let r = 0; r < u.length; r++){
|
|
25
|
+
let o = false;
|
|
26
|
+
for (const s of h){
|
|
27
|
+
if (d[s]?.includes(r)) {
|
|
28
|
+
const a = ParameterDecoratorFactory.getDecoratorHandler(s);
|
|
29
|
+
if (a) {
|
|
30
|
+
const e = getOwnCustomMetadata(getParamValueKey(s), l);
|
|
31
|
+
a(e[r], p, r);
|
|
32
|
+
} else {
|
|
33
|
+
const o = getOwnCustomMetadata(getParamIndexKey(s), l) || [];
|
|
34
|
+
o.push(r);
|
|
35
|
+
defineCustomMetadata(getParamIndexKey(s), o, p);
|
|
36
|
+
}
|
|
37
|
+
o = true;
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (!o && u[r]) {
|
|
42
|
+
g.push(u[r]);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return decorateAssemblage(p, getOwnCustomMetadata(ReflectValue.AssemblageDefinition, l));
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export { ConstructorDecorator, createConstructorDecorator };
|
package/dist/index28.js
CHANGED
|
@@ -1,22 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const Reflect = require('./index46.js');
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
const ReflectPrefix = '__';
|
|
7
|
-
const ReflectSuffix = '__';
|
|
8
|
-
exports.ReflectFlags = void 0;
|
|
9
|
-
(function(e) {
|
|
10
|
-
e["IsAssemblage"] = "is_assemblage";
|
|
11
|
-
})(exports.ReflectFlags || (exports.ReflectFlags = {}));
|
|
12
|
-
exports.ReflectValue = void 0;
|
|
13
|
-
(function(e) {
|
|
14
|
-
e["AssemblageDefinition"] = "assemblage:definition.value";
|
|
15
|
-
e["AssemblageContext"] = "assemblage:context.value";
|
|
16
|
-
e["TransversalAdvices"] = "transversal:advices";
|
|
17
|
-
e["AffectedMethods"] = "method:applied-aspects";
|
|
18
|
-
})(exports.ReflectValue || (exports.ReflectValue = {}));
|
|
19
|
-
|
|
20
|
-
exports.ReflectParamTypes = ReflectParamTypes;
|
|
21
|
-
exports.ReflectPrefix = ReflectPrefix;
|
|
22
|
-
exports.ReflectSuffix = ReflectSuffix;
|
|
5
|
+
Reflect.__require();
|
package/dist/index28.mjs
CHANGED
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
const ReflectPrefix = '__';
|
|
3
|
-
const ReflectSuffix = '__';
|
|
4
|
-
var ReflectFlags;
|
|
5
|
-
(function(e) {
|
|
6
|
-
e["IsAssemblage"] = "is_assemblage";
|
|
7
|
-
})(ReflectFlags || (ReflectFlags = {}));
|
|
8
|
-
var ReflectValue;
|
|
9
|
-
(function(e) {
|
|
10
|
-
e["AssemblageDefinition"] = "assemblage:definition.value";
|
|
11
|
-
e["AssemblageContext"] = "assemblage:context.value";
|
|
12
|
-
e["TransversalAdvices"] = "transversal:advices";
|
|
13
|
-
e["AffectedMethods"] = "method:applied-aspects";
|
|
14
|
-
})(ReflectValue || (ReflectValue = {}));
|
|
1
|
+
import { __require as require_Reflect } from './index46.mjs';
|
|
15
2
|
|
|
16
|
-
|
|
3
|
+
require_Reflect();
|
package/dist/index29.js
CHANGED
|
@@ -2,163 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
const ReflectParamTypes = 'design:paramtypes';
|
|
6
|
+
const ReflectPrefix = '__';
|
|
7
|
+
const ReflectSuffix = '__';
|
|
8
|
+
exports.ReflectFlags = void 0;
|
|
9
|
+
(function(e) {
|
|
10
|
+
e["IsAssemblage"] = "is_assemblage";
|
|
11
|
+
})(exports.ReflectFlags || (exports.ReflectFlags = {}));
|
|
12
|
+
exports.ReflectValue = void 0;
|
|
13
|
+
(function(e) {
|
|
14
|
+
e["AssemblageDefinition"] = "assemblage:definition.value";
|
|
15
|
+
e["AssemblageContext"] = "assemblage:context.value";
|
|
16
|
+
e["TransversalAdvices"] = "transversal:advices";
|
|
17
|
+
e["AffectedMethods"] = "method:applied-aspects";
|
|
18
|
+
})(exports.ReflectValue || (exports.ReflectValue = {}));
|
|
12
19
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if (typeof e === 'function') {
|
|
17
|
-
if (e.name) return e.name;
|
|
18
|
-
if (e.constructor?.name && e.constructor.name !== 'Function') {
|
|
19
|
-
return e.constructor.name;
|
|
20
|
-
}
|
|
21
|
-
return 'AnonymousFunction';
|
|
22
|
-
}
|
|
23
|
-
if (typeof e === 'string') return e;
|
|
24
|
-
if (typeof e === 'symbol') return e.toString();
|
|
25
|
-
if (typeof e === 'number') return String(e);
|
|
26
|
-
if (typeof e === 'boolean') return String(e);
|
|
27
|
-
if (typeof e === 'object') {
|
|
28
|
-
if (e.name && typeof e.name === 'string') {
|
|
29
|
-
return e.name;
|
|
30
|
-
}
|
|
31
|
-
const t = e.constructor?.name;
|
|
32
|
-
if (t && t !== 'Object') {
|
|
33
|
-
return t;
|
|
34
|
-
}
|
|
35
|
-
try {
|
|
36
|
-
const t = JSON.stringify(e);
|
|
37
|
-
if (t.length > 100) {
|
|
38
|
-
return t.substring(0, 100) + '...';
|
|
39
|
-
}
|
|
40
|
-
return t;
|
|
41
|
-
} catch {
|
|
42
|
-
return '[UnknownObject]';
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return String(e);
|
|
46
|
-
}
|
|
47
|
-
function c(e) {
|
|
48
|
-
if (core.isClass(e)) {
|
|
49
|
-
const t = e.prototype && Object.getOwnPropertyNames(e.prototype).length > 1;
|
|
50
|
-
return t ? 'class' : 'class';
|
|
51
|
-
}
|
|
52
|
-
if (typeof e === 'function') return 'function';
|
|
53
|
-
if (typeof e === 'string') return 'string';
|
|
54
|
-
if (typeof e === 'symbol') return 'symbol';
|
|
55
|
-
if (typeof e === 'object' && e !== null) return 'object';
|
|
56
|
-
return 'unknown';
|
|
57
|
-
}
|
|
58
|
-
class InjectableManager {
|
|
59
|
-
setContexts(e, t) {
|
|
60
|
-
this.privateContext = e;
|
|
61
|
-
this.publicContext = t;
|
|
62
|
-
}
|
|
63
|
-
register(i, o = false) {
|
|
64
|
-
const a = debugLogger.DebugLogger.getInstance();
|
|
65
|
-
const c = o === true ? use.resolveInstanceInjectionTuple(i) : inject.resolveInjectionTuple(i);
|
|
66
|
-
if (this.has(c.identifier)) {
|
|
67
|
-
const e = `An assemblage is already registered with identifier '${c.identifier.name}'.`;
|
|
68
|
-
a.log('error', 'Duplicate registration', {
|
|
69
|
-
identifier: c.identifier.name,
|
|
70
|
-
error: e
|
|
71
|
-
});
|
|
72
|
-
throw new Error(e);
|
|
73
|
-
}
|
|
74
|
-
const f = injectable.Injectable.of(c, this.privateContext, this.publicContext);
|
|
75
|
-
a.logRegistration(f);
|
|
76
|
-
this.injectables.set(f.identifier, f);
|
|
77
|
-
if (f.concrete) {
|
|
78
|
-
hookManager.HookManager.callHook(f.concrete, 'onRegister', this.publicContext, f.configuration);
|
|
79
|
-
}
|
|
80
|
-
return f;
|
|
81
|
-
}
|
|
82
|
-
has(e) {
|
|
83
|
-
return this.injectables.has(e);
|
|
84
|
-
}
|
|
85
|
-
require(e, t, n) {
|
|
86
|
-
if (!this.injectables.has(e)) {
|
|
87
|
-
const r = this.resolvingStack.has(e);
|
|
88
|
-
const i = r ? 'Circular dependency detected' : 'Dependency not registered';
|
|
89
|
-
const o = formatIdentifier(e);
|
|
90
|
-
const a = c(e);
|
|
91
|
-
const f = t?.__paramIndex;
|
|
92
|
-
const u = t?.__paramCount;
|
|
93
|
-
const l = t?.__expectedType;
|
|
94
|
-
const g = r ? `Circular dependency detected: '${o}' is already being resolved.` : `Dependency '${o}' has not been registered (Class/Service not found in current assemblages).`;
|
|
95
|
-
const d = {
|
|
96
|
-
identifier: o,
|
|
97
|
-
caller: n ? formatIdentifier(n) : 'unknown',
|
|
98
|
-
type: a,
|
|
99
|
-
error: g
|
|
100
|
-
};
|
|
101
|
-
if (f !== undefined) {
|
|
102
|
-
d.paramIndex = f;
|
|
103
|
-
}
|
|
104
|
-
if (u !== undefined) {
|
|
105
|
-
d.paramCount = u;
|
|
106
|
-
}
|
|
107
|
-
if (l !== undefined) {
|
|
108
|
-
const e = l?.name || formatIdentifier(l);
|
|
109
|
-
d.expectedType = e;
|
|
110
|
-
}
|
|
111
|
-
debugLogger.DebugLogger.getInstance().log('error', i, d);
|
|
112
|
-
throw new Error(g);
|
|
113
|
-
}
|
|
114
|
-
const r = this.injectables.get(e);
|
|
115
|
-
this.resolvingStack.add(r.identifier);
|
|
116
|
-
try {
|
|
117
|
-
if (r.isSingleton) {
|
|
118
|
-
return this.singletonStrategy.resolve(r, t);
|
|
119
|
-
} else {
|
|
120
|
-
return this.transientStrategy.resolve(r, t);
|
|
121
|
-
}
|
|
122
|
-
} finally{
|
|
123
|
-
this.resolvingStack.delete(r.identifier);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
concrete(e) {
|
|
127
|
-
const t = this.injectables.get(e);
|
|
128
|
-
if (t) return t.concrete;
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
tagged(...e) {
|
|
132
|
-
const t = [];
|
|
133
|
-
for (const n of e){
|
|
134
|
-
for (const [e, r] of this.injectables){
|
|
135
|
-
if (r.tags.includes(n)) t.push(r.build());
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
return t;
|
|
139
|
-
}
|
|
140
|
-
dispose() {
|
|
141
|
-
for (const [e, t] of this.injectables){
|
|
142
|
-
t.dispose();
|
|
143
|
-
}
|
|
144
|
-
this.resolvingStack.clear();
|
|
145
|
-
}
|
|
146
|
-
get size() {
|
|
147
|
-
return this.injectables.size;
|
|
148
|
-
}
|
|
149
|
-
getRegisteredIdentifiers() {
|
|
150
|
-
return Array.from(this.injectables.keys()).map((e)=>e?.name || String(e));
|
|
151
|
-
}
|
|
152
|
-
getInjectables() {
|
|
153
|
-
return this.injectables;
|
|
154
|
-
}
|
|
155
|
-
constructor(){
|
|
156
|
-
this.injectables = new Map();
|
|
157
|
-
this.resolvingStack = new Set();
|
|
158
|
-
this.singletonStrategy = new resolutionStrategies.SingletonStrategy();
|
|
159
|
-
this.transientStrategy = new resolutionStrategies.TransientStrategy();
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
exports.InjectableManager = InjectableManager;
|
|
164
|
-
exports.formatIdentifier = formatIdentifier;
|
|
20
|
+
exports.ReflectParamTypes = ReflectParamTypes;
|
|
21
|
+
exports.ReflectPrefix = ReflectPrefix;
|
|
22
|
+
exports.ReflectSuffix = ReflectSuffix;
|
package/dist/index29.mjs
CHANGED
|
@@ -1,159 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
const ReflectParamTypes = 'design:paramtypes';
|
|
2
|
+
const ReflectPrefix = '__';
|
|
3
|
+
const ReflectSuffix = '__';
|
|
4
|
+
var ReflectFlags;
|
|
5
|
+
(function(e) {
|
|
6
|
+
e["IsAssemblage"] = "is_assemblage";
|
|
7
|
+
})(ReflectFlags || (ReflectFlags = {}));
|
|
8
|
+
var ReflectValue;
|
|
9
|
+
(function(e) {
|
|
10
|
+
e["AssemblageDefinition"] = "assemblage:definition.value";
|
|
11
|
+
e["AssemblageContext"] = "assemblage:context.value";
|
|
12
|
+
e["TransversalAdvices"] = "transversal:advices";
|
|
13
|
+
e["AffectedMethods"] = "method:applied-aspects";
|
|
14
|
+
})(ReflectValue || (ReflectValue = {}));
|
|
8
15
|
|
|
9
|
-
|
|
10
|
-
if (e === undefined) return 'undefined';
|
|
11
|
-
if (e === null) return 'null';
|
|
12
|
-
if (typeof e === 'function') {
|
|
13
|
-
if (e.name) return e.name;
|
|
14
|
-
if (e.constructor?.name && e.constructor.name !== 'Function') {
|
|
15
|
-
return e.constructor.name;
|
|
16
|
-
}
|
|
17
|
-
return 'AnonymousFunction';
|
|
18
|
-
}
|
|
19
|
-
if (typeof e === 'string') return e;
|
|
20
|
-
if (typeof e === 'symbol') return e.toString();
|
|
21
|
-
if (typeof e === 'number') return String(e);
|
|
22
|
-
if (typeof e === 'boolean') return String(e);
|
|
23
|
-
if (typeof e === 'object') {
|
|
24
|
-
if (e.name && typeof e.name === 'string') {
|
|
25
|
-
return e.name;
|
|
26
|
-
}
|
|
27
|
-
const t = e.constructor?.name;
|
|
28
|
-
if (t && t !== 'Object') {
|
|
29
|
-
return t;
|
|
30
|
-
}
|
|
31
|
-
try {
|
|
32
|
-
const t = JSON.stringify(e);
|
|
33
|
-
if (t.length > 100) {
|
|
34
|
-
return t.substring(0, 100) + '...';
|
|
35
|
-
}
|
|
36
|
-
return t;
|
|
37
|
-
} catch {
|
|
38
|
-
return '[UnknownObject]';
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return String(e);
|
|
42
|
-
}
|
|
43
|
-
function c(e) {
|
|
44
|
-
if (isClass(e)) {
|
|
45
|
-
const t = e.prototype && Object.getOwnPropertyNames(e.prototype).length > 1;
|
|
46
|
-
return t ? 'class' : 'class';
|
|
47
|
-
}
|
|
48
|
-
if (typeof e === 'function') return 'function';
|
|
49
|
-
if (typeof e === 'string') return 'string';
|
|
50
|
-
if (typeof e === 'symbol') return 'symbol';
|
|
51
|
-
if (typeof e === 'object' && e !== null) return 'object';
|
|
52
|
-
return 'unknown';
|
|
53
|
-
}
|
|
54
|
-
class InjectableManager {
|
|
55
|
-
setContexts(e, t) {
|
|
56
|
-
this.privateContext = e;
|
|
57
|
-
this.publicContext = t;
|
|
58
|
-
}
|
|
59
|
-
register(i, o = false) {
|
|
60
|
-
const a = DebugLogger.getInstance();
|
|
61
|
-
const c = o === true ? resolveInstanceInjectionTuple(i) : resolveInjectionTuple(i);
|
|
62
|
-
if (this.has(c.identifier)) {
|
|
63
|
-
const e = `An assemblage is already registered with identifier '${c.identifier.name}'.`;
|
|
64
|
-
a.log('error', 'Duplicate registration', {
|
|
65
|
-
identifier: c.identifier.name,
|
|
66
|
-
error: e
|
|
67
|
-
});
|
|
68
|
-
throw new Error(e);
|
|
69
|
-
}
|
|
70
|
-
const f = Injectable.of(c, this.privateContext, this.publicContext);
|
|
71
|
-
a.logRegistration(f);
|
|
72
|
-
this.injectables.set(f.identifier, f);
|
|
73
|
-
if (f.concrete) {
|
|
74
|
-
HookManager.callHook(f.concrete, 'onRegister', this.publicContext, f.configuration);
|
|
75
|
-
}
|
|
76
|
-
return f;
|
|
77
|
-
}
|
|
78
|
-
has(e) {
|
|
79
|
-
return this.injectables.has(e);
|
|
80
|
-
}
|
|
81
|
-
require(e, t, n) {
|
|
82
|
-
if (!this.injectables.has(e)) {
|
|
83
|
-
const r = this.resolvingStack.has(e);
|
|
84
|
-
const i = r ? 'Circular dependency detected' : 'Dependency not registered';
|
|
85
|
-
const o = formatIdentifier(e);
|
|
86
|
-
const a = c(e);
|
|
87
|
-
const f = t?.__paramIndex;
|
|
88
|
-
const u = t?.__paramCount;
|
|
89
|
-
const l = t?.__expectedType;
|
|
90
|
-
const g = r ? `Circular dependency detected: '${o}' is already being resolved.` : `Dependency '${o}' has not been registered (Class/Service not found in current assemblages).`;
|
|
91
|
-
const d = {
|
|
92
|
-
identifier: o,
|
|
93
|
-
caller: n ? formatIdentifier(n) : 'unknown',
|
|
94
|
-
type: a,
|
|
95
|
-
error: g
|
|
96
|
-
};
|
|
97
|
-
if (f !== undefined) {
|
|
98
|
-
d.paramIndex = f;
|
|
99
|
-
}
|
|
100
|
-
if (u !== undefined) {
|
|
101
|
-
d.paramCount = u;
|
|
102
|
-
}
|
|
103
|
-
if (l !== undefined) {
|
|
104
|
-
const e = l?.name || formatIdentifier(l);
|
|
105
|
-
d.expectedType = e;
|
|
106
|
-
}
|
|
107
|
-
DebugLogger.getInstance().log('error', i, d);
|
|
108
|
-
throw new Error(g);
|
|
109
|
-
}
|
|
110
|
-
const r = this.injectables.get(e);
|
|
111
|
-
this.resolvingStack.add(r.identifier);
|
|
112
|
-
try {
|
|
113
|
-
if (r.isSingleton) {
|
|
114
|
-
return this.singletonStrategy.resolve(r, t);
|
|
115
|
-
} else {
|
|
116
|
-
return this.transientStrategy.resolve(r, t);
|
|
117
|
-
}
|
|
118
|
-
} finally{
|
|
119
|
-
this.resolvingStack.delete(r.identifier);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
concrete(e) {
|
|
123
|
-
const t = this.injectables.get(e);
|
|
124
|
-
if (t) return t.concrete;
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
tagged(...e) {
|
|
128
|
-
const t = [];
|
|
129
|
-
for (const n of e){
|
|
130
|
-
for (const [e, r] of this.injectables){
|
|
131
|
-
if (r.tags.includes(n)) t.push(r.build());
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
return t;
|
|
135
|
-
}
|
|
136
|
-
dispose() {
|
|
137
|
-
for (const [e, t] of this.injectables){
|
|
138
|
-
t.dispose();
|
|
139
|
-
}
|
|
140
|
-
this.resolvingStack.clear();
|
|
141
|
-
}
|
|
142
|
-
get size() {
|
|
143
|
-
return this.injectables.size;
|
|
144
|
-
}
|
|
145
|
-
getRegisteredIdentifiers() {
|
|
146
|
-
return Array.from(this.injectables.keys()).map((e)=>e?.name || String(e));
|
|
147
|
-
}
|
|
148
|
-
getInjectables() {
|
|
149
|
-
return this.injectables;
|
|
150
|
-
}
|
|
151
|
-
constructor(){
|
|
152
|
-
this.injectables = new Map();
|
|
153
|
-
this.resolvingStack = new Set();
|
|
154
|
-
this.singletonStrategy = new SingletonStrategy();
|
|
155
|
-
this.transientStrategy = new TransientStrategy();
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
export { InjectableManager, formatIdentifier };
|
|
16
|
+
export { ReflectFlags, ReflectParamTypes, ReflectPrefix, ReflectSuffix, ReflectValue };
|
package/dist/index3.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const constants = require('./
|
|
6
|
-
const reflection = require('./
|
|
5
|
+
const constants = require('./index29.js');
|
|
6
|
+
const reflection = require('./index38.js');
|
|
7
7
|
|
|
8
8
|
const isAssemblage = (s)=>{
|
|
9
9
|
return reflection.getOwnCustomMetadata(constants.ReflectFlags.IsAssemblage, s) || false;
|
package/dist/index3.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReflectFlags, ReflectValue } from './
|
|
2
|
-
import { getOwnCustomMetadata } from './
|
|
1
|
+
import { ReflectFlags, ReflectValue } from './index29.mjs';
|
|
2
|
+
import { getOwnCustomMetadata } from './index38.mjs';
|
|
3
3
|
|
|
4
4
|
const isAssemblage = (s)=>{
|
|
5
5
|
return getOwnCustomMetadata(ReflectFlags.IsAssemblage, s) || false;
|
package/dist/index30.js
CHANGED
|
@@ -2,55 +2,45 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const eventManager = require('./index6.js');
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
debugLogger.DebugLogger.getInstance().log('error', 'Duplicate object/value registration', {
|
|
16
|
-
identifier: o,
|
|
17
|
-
type: t(r),
|
|
18
|
-
error: s
|
|
19
|
-
});
|
|
20
|
-
throw new Error(s);
|
|
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);
|
|
21
15
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
has(e) {
|
|
26
|
-
return this.objects.has(e);
|
|
27
|
-
}
|
|
28
|
-
require(r) {
|
|
29
|
-
if (!this.objects.has(r)) {
|
|
30
|
-
const o = typeof r === 'symbol' ? r.toString() : String(r);
|
|
31
|
-
const s = `Object/value '${o}' has not been registered in the object store.`;
|
|
32
|
-
debugLogger.DebugLogger.getInstance().log('error', 'Object/value not found', {
|
|
33
|
-
identifier: o,
|
|
34
|
-
type: t(r),
|
|
35
|
-
error: s
|
|
16
|
+
for (const e of t.events){
|
|
17
|
+
n.on(e, (...n)=>{
|
|
18
|
+
t.privateContext.emit(e, ...n);
|
|
36
19
|
});
|
|
37
|
-
throw new Error(s);
|
|
38
20
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
if (this.globals.has(e)) {
|
|
43
|
-
throw new Error(`Global value with key '${e}' has already been registered.`);
|
|
21
|
+
} else {
|
|
22
|
+
for (const e of t.events){
|
|
23
|
+
if (!t.privateContext.events.has(e)) t.privateContext.addChannels(e);
|
|
44
24
|
}
|
|
45
|
-
this.globals.set(e, t);
|
|
46
25
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
+
}
|
|
53
42
|
}
|
|
54
|
-
}
|
|
43
|
+
};
|
|
55
44
|
|
|
56
|
-
exports.
|
|
45
|
+
exports.registerEvents = registerEvents;
|
|
46
|
+
exports.unregisterEvents = unregisterEvents;
|
package/dist/index30.mjs
CHANGED
|
@@ -1,52 +1,41 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EventManager } from './index6.mjs';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
DebugLogger.getInstance().log('error', 'Duplicate object/value registration', {
|
|
12
|
-
identifier: o,
|
|
13
|
-
type: t(r),
|
|
14
|
-
error: s
|
|
15
|
-
});
|
|
16
|
-
throw new Error(s);
|
|
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);
|
|
17
11
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
has(e) {
|
|
22
|
-
return this.objects.has(e);
|
|
23
|
-
}
|
|
24
|
-
require(r) {
|
|
25
|
-
if (!this.objects.has(r)) {
|
|
26
|
-
const o = typeof r === 'symbol' ? r.toString() : String(r);
|
|
27
|
-
const s = `Object/value '${o}' has not been registered in the object store.`;
|
|
28
|
-
DebugLogger.getInstance().log('error', 'Object/value not found', {
|
|
29
|
-
identifier: o,
|
|
30
|
-
type: t(r),
|
|
31
|
-
error: s
|
|
12
|
+
for (const e of t.events){
|
|
13
|
+
n.on(e, (...n)=>{
|
|
14
|
+
t.privateContext.emit(e, ...n);
|
|
32
15
|
});
|
|
33
|
-
throw new Error(s);
|
|
34
16
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (this.globals.has(e)) {
|
|
39
|
-
throw new Error(`Global value with key '${e}' has already been registered.`);
|
|
17
|
+
} else {
|
|
18
|
+
for (const e of t.events){
|
|
19
|
+
if (!t.privateContext.events.has(e)) t.privateContext.addChannels(e);
|
|
40
20
|
}
|
|
41
|
-
this.globals.set(e, t);
|
|
42
21
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
+
}
|
|
49
38
|
}
|
|
50
|
-
}
|
|
39
|
+
};
|
|
51
40
|
|
|
52
|
-
export {
|
|
41
|
+
export { registerEvents, unregisterEvents };
|