assemblerjs 1.1.22 → 1.1.24
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 +4 -0
- package/dist/index11.js +1 -1
- package/dist/index11.mjs +1 -1
- package/dist/index13.js +1 -1
- package/dist/index13.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 +1 -1
- package/dist/index2.mjs +1 -1
- 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 +1 -1
- package/dist/index22.mjs +1 -1
- package/dist/index23.js +1 -1
- package/dist/index23.mjs +1 -1
- package/dist/index24.js +1 -1
- package/dist/index24.mjs +1 -1
- package/dist/index32.js +1 -1
- package/dist/index32.mjs +1 -1
- package/dist/index37.js +18 -103
- package/dist/index37.mjs +18 -101
- package/dist/index38.js +103 -18
- package/dist/index38.mjs +101 -18
- package/dist/index40.js +92 -74
- package/dist/index40.mjs +92 -74
- package/dist/index45.js +27 -27
- package/dist/index45.mjs +27 -27
- package/dist/index49.js +1 -1
- package/dist/index49.mjs +1 -1
- package/package.json +1 -1
package/dist/index38.mjs
CHANGED
|
@@ -1,24 +1,107 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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;
|
|
9
13
|
}
|
|
10
|
-
|
|
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
|
|
11
71
|
}
|
|
12
|
-
|
|
13
|
-
|
|
72
|
+
};
|
|
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.`);
|
|
80
|
+
}
|
|
14
81
|
}
|
|
15
|
-
|
|
16
|
-
|
|
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]);
|
|
17
90
|
}
|
|
18
|
-
|
|
19
|
-
|
|
91
|
+
return e;
|
|
92
|
+
};
|
|
93
|
+
const getDefinition = (e)=>{
|
|
94
|
+
if (!isAssemblage(e)) {
|
|
95
|
+
throw new Error(`Class '${e.name}' is not an assemblage or transversal.`);
|
|
20
96
|
}
|
|
21
|
-
|
|
22
|
-
|
|
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
|
+
};
|
|
23
106
|
|
|
24
|
-
export {
|
|
107
|
+
export { getDefinition, setDefinitionValue, validateDefinition };
|
package/dist/index40.js
CHANGED
|
@@ -6,106 +6,124 @@ const transversalManager = require('./index13.js');
|
|
|
6
6
|
const affect = require('./index12.js');
|
|
7
7
|
|
|
8
8
|
class TransversalWeaver {
|
|
9
|
-
static
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const f = Object.getOwnPropertyNames(a).some((t)=>{
|
|
14
|
-
if (t === 'constructor') return false;
|
|
15
|
-
const n = Object.getOwnPropertyDescriptor(a, t);
|
|
16
|
-
if (!n) return false;
|
|
17
|
-
const r = n.value && typeof n.value === 'function';
|
|
18
|
-
const o = n.get && typeof n.get === 'function';
|
|
19
|
-
if (!r && !o) return false;
|
|
20
|
-
const c = affect.getAffectedMethods(a, t);
|
|
21
|
-
return c.length > 0;
|
|
9
|
+
static registerCaller(e, t, r) {
|
|
10
|
+
this.callerRegistry.set(e, {
|
|
11
|
+
className: t,
|
|
12
|
+
identifier: r
|
|
22
13
|
});
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
}
|
|
15
|
+
static getCallerMetadata(e) {
|
|
16
|
+
return this.callerRegistry.get(e);
|
|
17
|
+
}
|
|
18
|
+
static weave(r, n, s) {
|
|
19
|
+
const a = transversalManager.TransversalManager.getInstance(s);
|
|
20
|
+
const c = a.getAspectsForTarget(n);
|
|
21
|
+
const o = Object.getPrototypeOf(r);
|
|
22
|
+
const i = Object.getOwnPropertyNames(o).some((e)=>{
|
|
23
|
+
if (e === 'constructor') return false;
|
|
24
|
+
const r = Object.getOwnPropertyDescriptor(o, e);
|
|
25
|
+
if (!r) return false;
|
|
26
|
+
const n = r.value && typeof r.value === 'function';
|
|
27
|
+
const s = r.get && typeof r.get === 'function';
|
|
28
|
+
if (!n && !s) return false;
|
|
29
|
+
const a = affect.getAffectedMethods(o, e);
|
|
30
|
+
return a.length > 0;
|
|
31
|
+
});
|
|
32
|
+
if (c.length === 0 && !i) {
|
|
33
|
+
return r;
|
|
25
34
|
}
|
|
26
|
-
|
|
27
|
-
get (
|
|
28
|
-
const
|
|
29
|
-
if (typeof
|
|
30
|
-
return
|
|
35
|
+
const l = new Proxy(r, {
|
|
36
|
+
get (e, t, r) {
|
|
37
|
+
const n = Reflect.get(e, t, r);
|
|
38
|
+
if (typeof n !== 'function') {
|
|
39
|
+
return n;
|
|
31
40
|
}
|
|
32
|
-
return function(...
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
41
|
+
return function(...r) {
|
|
42
|
+
const s = String(t);
|
|
43
|
+
const o = TransversalWeaver.callerRegistry.get(this);
|
|
44
|
+
const i = {
|
|
45
|
+
target: e,
|
|
46
|
+
methodName: s,
|
|
47
|
+
args: r,
|
|
48
|
+
caller: o?.className,
|
|
49
|
+
callerIdentifier: o?.identifier
|
|
38
50
|
};
|
|
39
|
-
const
|
|
40
|
-
return TransversalWeaver.executeAdviceChain(
|
|
51
|
+
const l = a.getAdvicesForJoinPoint(i, c, e, t);
|
|
52
|
+
return TransversalWeaver.executeAdviceChain(l, n, e, r, i);
|
|
41
53
|
};
|
|
42
54
|
}
|
|
43
55
|
});
|
|
56
|
+
TransversalWeaver.callerRegistry.set(l, {
|
|
57
|
+
className: n.name,
|
|
58
|
+
identifier: n.name
|
|
59
|
+
});
|
|
60
|
+
return l;
|
|
44
61
|
}
|
|
45
|
-
static executeAdviceChain(t,
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
const
|
|
62
|
+
static executeAdviceChain(e, t, r, n, s) {
|
|
63
|
+
const a = e.filter((e)=>e.type === 'before');
|
|
64
|
+
const c = e.filter((e)=>e.type === 'around');
|
|
65
|
+
const o = e.filter((e)=>e.type === 'after');
|
|
49
66
|
try {
|
|
50
|
-
for (const
|
|
51
|
-
const
|
|
52
|
-
...
|
|
53
|
-
config:
|
|
67
|
+
for (const e of a){
|
|
68
|
+
const t = {
|
|
69
|
+
...s,
|
|
70
|
+
config: e.config
|
|
54
71
|
};
|
|
55
|
-
|
|
72
|
+
e.method.call(e.transversalInstance, t);
|
|
56
73
|
}
|
|
57
|
-
let
|
|
58
|
-
if (
|
|
59
|
-
|
|
74
|
+
let e;
|
|
75
|
+
if (c.length > 0) {
|
|
76
|
+
e = this.buildAroundChain(c, t, r, n, s);
|
|
60
77
|
} else {
|
|
61
|
-
|
|
78
|
+
e = t.apply(r, n);
|
|
62
79
|
}
|
|
63
|
-
if (
|
|
64
|
-
return
|
|
65
|
-
for (const
|
|
66
|
-
const
|
|
67
|
-
...
|
|
68
|
-
result:
|
|
80
|
+
if (e instanceof Promise) {
|
|
81
|
+
return e.then((e)=>{
|
|
82
|
+
for (const t of o){
|
|
83
|
+
const r = {
|
|
84
|
+
...s,
|
|
85
|
+
result: e
|
|
69
86
|
};
|
|
70
|
-
|
|
87
|
+
t.method.call(t.transversalInstance, r);
|
|
71
88
|
}
|
|
72
|
-
return
|
|
73
|
-
}).catch((
|
|
74
|
-
|
|
75
|
-
throw
|
|
89
|
+
return e;
|
|
90
|
+
}).catch((e)=>{
|
|
91
|
+
s.error = e;
|
|
92
|
+
throw e;
|
|
76
93
|
});
|
|
77
94
|
}
|
|
78
|
-
for (const
|
|
79
|
-
const
|
|
80
|
-
...
|
|
81
|
-
result:
|
|
82
|
-
config:
|
|
95
|
+
for (const t of o){
|
|
96
|
+
const r = {
|
|
97
|
+
...s,
|
|
98
|
+
result: e,
|
|
99
|
+
config: t.config
|
|
83
100
|
};
|
|
84
|
-
|
|
101
|
+
t.method.call(t.transversalInstance, r);
|
|
85
102
|
}
|
|
86
|
-
return
|
|
87
|
-
} catch (
|
|
88
|
-
|
|
89
|
-
throw
|
|
103
|
+
return e;
|
|
104
|
+
} catch (e) {
|
|
105
|
+
s.error = e;
|
|
106
|
+
throw e;
|
|
90
107
|
}
|
|
91
108
|
}
|
|
92
|
-
static buildAroundChain(t,
|
|
93
|
-
let
|
|
94
|
-
const
|
|
95
|
-
if (
|
|
96
|
-
const
|
|
97
|
-
const
|
|
98
|
-
...
|
|
99
|
-
proceed:
|
|
100
|
-
config:
|
|
109
|
+
static buildAroundChain(e, t, r, n, s) {
|
|
110
|
+
let a = 0;
|
|
111
|
+
const c = ()=>{
|
|
112
|
+
if (a < e.length) {
|
|
113
|
+
const t = e[a++];
|
|
114
|
+
const r = {
|
|
115
|
+
...s,
|
|
116
|
+
proceed: c,
|
|
117
|
+
config: t.config
|
|
101
118
|
};
|
|
102
|
-
return
|
|
119
|
+
return t.method.call(t.transversalInstance, r);
|
|
103
120
|
} else {
|
|
104
|
-
return
|
|
121
|
+
return t.apply(r, n);
|
|
105
122
|
}
|
|
106
123
|
};
|
|
107
|
-
return
|
|
124
|
+
return c();
|
|
108
125
|
}
|
|
109
126
|
}
|
|
127
|
+
TransversalWeaver.callerRegistry = new WeakMap();
|
|
110
128
|
|
|
111
129
|
exports.TransversalWeaver = TransversalWeaver;
|
package/dist/index40.mjs
CHANGED
|
@@ -2,106 +2,124 @@ import { TransversalManager } from './index13.mjs';
|
|
|
2
2
|
import { getAffectedMethods } from './index12.mjs';
|
|
3
3
|
|
|
4
4
|
class TransversalWeaver {
|
|
5
|
-
static
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const f = Object.getOwnPropertyNames(a).some((t)=>{
|
|
10
|
-
if (t === 'constructor') return false;
|
|
11
|
-
const n = Object.getOwnPropertyDescriptor(a, t);
|
|
12
|
-
if (!n) return false;
|
|
13
|
-
const r = n.value && typeof n.value === 'function';
|
|
14
|
-
const o = n.get && typeof n.get === 'function';
|
|
15
|
-
if (!r && !o) return false;
|
|
16
|
-
const c = getAffectedMethods(a, t);
|
|
17
|
-
return c.length > 0;
|
|
5
|
+
static registerCaller(e, t, r) {
|
|
6
|
+
this.callerRegistry.set(e, {
|
|
7
|
+
className: t,
|
|
8
|
+
identifier: r
|
|
18
9
|
});
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
}
|
|
11
|
+
static getCallerMetadata(e) {
|
|
12
|
+
return this.callerRegistry.get(e);
|
|
13
|
+
}
|
|
14
|
+
static weave(r, n, s) {
|
|
15
|
+
const a = TransversalManager.getInstance(s);
|
|
16
|
+
const c = a.getAspectsForTarget(n);
|
|
17
|
+
const o = Object.getPrototypeOf(r);
|
|
18
|
+
const i = Object.getOwnPropertyNames(o).some((e)=>{
|
|
19
|
+
if (e === 'constructor') return false;
|
|
20
|
+
const r = Object.getOwnPropertyDescriptor(o, e);
|
|
21
|
+
if (!r) return false;
|
|
22
|
+
const n = r.value && typeof r.value === 'function';
|
|
23
|
+
const s = r.get && typeof r.get === 'function';
|
|
24
|
+
if (!n && !s) return false;
|
|
25
|
+
const a = getAffectedMethods(o, e);
|
|
26
|
+
return a.length > 0;
|
|
27
|
+
});
|
|
28
|
+
if (c.length === 0 && !i) {
|
|
29
|
+
return r;
|
|
21
30
|
}
|
|
22
|
-
|
|
23
|
-
get (
|
|
24
|
-
const
|
|
25
|
-
if (typeof
|
|
26
|
-
return
|
|
31
|
+
const l = new Proxy(r, {
|
|
32
|
+
get (e, t, r) {
|
|
33
|
+
const n = Reflect.get(e, t, r);
|
|
34
|
+
if (typeof n !== 'function') {
|
|
35
|
+
return n;
|
|
27
36
|
}
|
|
28
|
-
return function(...
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
return function(...r) {
|
|
38
|
+
const s = String(t);
|
|
39
|
+
const o = TransversalWeaver.callerRegistry.get(this);
|
|
40
|
+
const i = {
|
|
41
|
+
target: e,
|
|
42
|
+
methodName: s,
|
|
43
|
+
args: r,
|
|
44
|
+
caller: o?.className,
|
|
45
|
+
callerIdentifier: o?.identifier
|
|
34
46
|
};
|
|
35
|
-
const
|
|
36
|
-
return TransversalWeaver.executeAdviceChain(
|
|
47
|
+
const l = a.getAdvicesForJoinPoint(i, c, e, t);
|
|
48
|
+
return TransversalWeaver.executeAdviceChain(l, n, e, r, i);
|
|
37
49
|
};
|
|
38
50
|
}
|
|
39
51
|
});
|
|
52
|
+
TransversalWeaver.callerRegistry.set(l, {
|
|
53
|
+
className: n.name,
|
|
54
|
+
identifier: n.name
|
|
55
|
+
});
|
|
56
|
+
return l;
|
|
40
57
|
}
|
|
41
|
-
static executeAdviceChain(t,
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
const
|
|
58
|
+
static executeAdviceChain(e, t, r, n, s) {
|
|
59
|
+
const a = e.filter((e)=>e.type === 'before');
|
|
60
|
+
const c = e.filter((e)=>e.type === 'around');
|
|
61
|
+
const o = e.filter((e)=>e.type === 'after');
|
|
45
62
|
try {
|
|
46
|
-
for (const
|
|
47
|
-
const
|
|
48
|
-
...
|
|
49
|
-
config:
|
|
63
|
+
for (const e of a){
|
|
64
|
+
const t = {
|
|
65
|
+
...s,
|
|
66
|
+
config: e.config
|
|
50
67
|
};
|
|
51
|
-
|
|
68
|
+
e.method.call(e.transversalInstance, t);
|
|
52
69
|
}
|
|
53
|
-
let
|
|
54
|
-
if (
|
|
55
|
-
|
|
70
|
+
let e;
|
|
71
|
+
if (c.length > 0) {
|
|
72
|
+
e = this.buildAroundChain(c, t, r, n, s);
|
|
56
73
|
} else {
|
|
57
|
-
|
|
74
|
+
e = t.apply(r, n);
|
|
58
75
|
}
|
|
59
|
-
if (
|
|
60
|
-
return
|
|
61
|
-
for (const
|
|
62
|
-
const
|
|
63
|
-
...
|
|
64
|
-
result:
|
|
76
|
+
if (e instanceof Promise) {
|
|
77
|
+
return e.then((e)=>{
|
|
78
|
+
for (const t of o){
|
|
79
|
+
const r = {
|
|
80
|
+
...s,
|
|
81
|
+
result: e
|
|
65
82
|
};
|
|
66
|
-
|
|
83
|
+
t.method.call(t.transversalInstance, r);
|
|
67
84
|
}
|
|
68
|
-
return
|
|
69
|
-
}).catch((
|
|
70
|
-
|
|
71
|
-
throw
|
|
85
|
+
return e;
|
|
86
|
+
}).catch((e)=>{
|
|
87
|
+
s.error = e;
|
|
88
|
+
throw e;
|
|
72
89
|
});
|
|
73
90
|
}
|
|
74
|
-
for (const
|
|
75
|
-
const
|
|
76
|
-
...
|
|
77
|
-
result:
|
|
78
|
-
config:
|
|
91
|
+
for (const t of o){
|
|
92
|
+
const r = {
|
|
93
|
+
...s,
|
|
94
|
+
result: e,
|
|
95
|
+
config: t.config
|
|
79
96
|
};
|
|
80
|
-
|
|
97
|
+
t.method.call(t.transversalInstance, r);
|
|
81
98
|
}
|
|
82
|
-
return
|
|
83
|
-
} catch (
|
|
84
|
-
|
|
85
|
-
throw
|
|
99
|
+
return e;
|
|
100
|
+
} catch (e) {
|
|
101
|
+
s.error = e;
|
|
102
|
+
throw e;
|
|
86
103
|
}
|
|
87
104
|
}
|
|
88
|
-
static buildAroundChain(t,
|
|
89
|
-
let
|
|
90
|
-
const
|
|
91
|
-
if (
|
|
92
|
-
const
|
|
93
|
-
const
|
|
94
|
-
...
|
|
95
|
-
proceed:
|
|
96
|
-
config:
|
|
105
|
+
static buildAroundChain(e, t, r, n, s) {
|
|
106
|
+
let a = 0;
|
|
107
|
+
const c = ()=>{
|
|
108
|
+
if (a < e.length) {
|
|
109
|
+
const t = e[a++];
|
|
110
|
+
const r = {
|
|
111
|
+
...s,
|
|
112
|
+
proceed: c,
|
|
113
|
+
config: t.config
|
|
97
114
|
};
|
|
98
|
-
return
|
|
115
|
+
return t.method.call(t.transversalInstance, r);
|
|
99
116
|
} else {
|
|
100
|
-
return
|
|
117
|
+
return t.apply(r, n);
|
|
101
118
|
}
|
|
102
119
|
};
|
|
103
|
-
return
|
|
120
|
+
return c();
|
|
104
121
|
}
|
|
105
122
|
}
|
|
123
|
+
TransversalWeaver.callerRegistry = new WeakMap();
|
|
106
124
|
|
|
107
125
|
export { TransversalWeaver };
|
package/dist/index45.js
CHANGED
|
@@ -12,7 +12,7 @@ const helpers = require('./index39.js');
|
|
|
12
12
|
const hookManager = require('./index31.js');
|
|
13
13
|
const helpers$1 = require('./index3.js');
|
|
14
14
|
const use = require('./index43.js');
|
|
15
|
-
const schema = require('./
|
|
15
|
+
const schema = require('./index38.js');
|
|
16
16
|
const decorators = require('./index11.js');
|
|
17
17
|
const transversalManager = require('./index13.js');
|
|
18
18
|
|
|
@@ -135,6 +135,32 @@ class Injectable {
|
|
|
135
135
|
if (this.concrete) {
|
|
136
136
|
const t = debugLogger.DebugLogger.getInstance();
|
|
137
137
|
reflection.defineCustomMetadata(constants.ReflectValue.AssemblageContext, this.publicContext, this.concrete);
|
|
138
|
+
if (this.globals) {
|
|
139
|
+
const e = Object.keys(this.globals);
|
|
140
|
+
const i = e.map((t)=>{
|
|
141
|
+
const e = this.globals[t];
|
|
142
|
+
return {
|
|
143
|
+
key: t,
|
|
144
|
+
value: e
|
|
145
|
+
};
|
|
146
|
+
});
|
|
147
|
+
if (e.length > 0) {
|
|
148
|
+
t.logPhaseStart('registrationGlobals', {
|
|
149
|
+
target: this.concrete?.name ?? String(this.identifier),
|
|
150
|
+
count: e.length,
|
|
151
|
+
keys: e,
|
|
152
|
+
values: i
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
for(const t in this.globals){
|
|
156
|
+
this.privateContext.addGlobal(t, this.globals[t]);
|
|
157
|
+
}
|
|
158
|
+
if (e.length > 0) {
|
|
159
|
+
t.logPhaseEnd('registrationGlobals', undefined, {
|
|
160
|
+
target: this.concrete?.name ?? String(this.identifier)
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
138
164
|
for (const t of this.transversals){
|
|
139
165
|
const e = this.resolveTransversalToInjection(t);
|
|
140
166
|
this.privateContext.register(e);
|
|
@@ -208,32 +234,6 @@ class Injectable {
|
|
|
208
234
|
}
|
|
209
235
|
}
|
|
210
236
|
this.dependenciesIds = this.concrete ? dependencies.resolveDependencies(this.concrete) : [];
|
|
211
|
-
if (this.globals) {
|
|
212
|
-
const e = Object.keys(this.globals);
|
|
213
|
-
const i = e.map((t)=>{
|
|
214
|
-
const e = this.globals[t];
|
|
215
|
-
return {
|
|
216
|
-
key: t,
|
|
217
|
-
value: e
|
|
218
|
-
};
|
|
219
|
-
});
|
|
220
|
-
if (e.length > 0) {
|
|
221
|
-
t.logPhaseStart('registrationGlobals', {
|
|
222
|
-
target: this.concrete?.name ?? String(this.identifier),
|
|
223
|
-
count: e.length,
|
|
224
|
-
keys: e,
|
|
225
|
-
values: i
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
for(const t in this.globals){
|
|
229
|
-
this.privateContext.addGlobal(t, this.globals[t]);
|
|
230
|
-
}
|
|
231
|
-
if (e.length > 0) {
|
|
232
|
-
t.logPhaseEnd('registrationGlobals', undefined, {
|
|
233
|
-
target: this.concrete?.name ?? String(this.identifier)
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
237
|
}
|
|
238
238
|
if (t.instance) {
|
|
239
239
|
this.singletonInstance = t.instance;
|