assemblerjs 1.0.0 → 1.1.0
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/README.md +29 -53
- package/dist/index.d.ts +430 -9
- package/dist/index.js +24 -12
- package/dist/index.mjs +16 -12
- package/dist/index11.js +82 -20
- package/dist/index11.mjs +78 -20
- package/dist/index12.js +17 -8
- package/dist/index12.mjs +16 -8
- package/dist/index13.js +148 -73
- package/dist/index13.mjs +148 -73
- package/dist/index14.js +4 -17
- package/dist/index14.mjs +4 -17
- package/dist/index15.js +21 -16
- package/dist/index15.mjs +21 -16
- package/dist/index16.js +10 -16
- package/dist/index16.mjs +10 -16
- package/dist/index17.js +88 -16
- package/dist/index17.mjs +88 -16
- package/dist/index18.js +11 -20
- package/dist/index18.mjs +11 -19
- package/dist/index19.js +11 -20
- package/dist/index19.mjs +11 -19
- package/dist/index2.js +3 -3
- package/dist/index2.mjs +3 -3
- package/dist/index20.js +11 -20
- package/dist/index20.mjs +11 -20
- package/dist/index21.js +14 -25
- package/dist/index21.mjs +14 -21
- package/dist/index22.js +24 -46
- package/dist/index22.mjs +23 -45
- package/dist/index23.js +25 -63
- package/dist/index23.mjs +24 -63
- package/dist/index24.js +24 -30
- package/dist/index24.mjs +24 -30
- package/dist/index25.js +24 -62
- package/dist/index25.mjs +20 -62
- package/dist/index26.js +46 -30
- package/dist/index26.mjs +45 -30
- package/dist/index27.js +2 -34
- package/dist/index27.mjs +2 -32
- package/dist/index28.js +17 -41
- package/dist/index28.mjs +15 -40
- package/dist/index29.js +64 -15
- package/dist/index29.mjs +64 -13
- package/dist/index3.js +2 -2
- package/dist/index3.mjs +2 -2
- package/dist/index30.js +32 -14
- package/dist/index30.mjs +32 -12
- package/dist/index31.js +57 -86
- package/dist/index31.mjs +57 -84
- package/dist/index32.js +28 -19
- package/dist/index32.mjs +28 -19
- package/dist/index33.js +28 -25
- package/dist/index33.mjs +28 -24
- package/dist/index34.js +17 -8
- package/dist/index34.mjs +14 -8
- package/dist/index35.js +23 -49
- package/dist/index35.mjs +23 -49
- package/dist/index36.js +37 -108
- package/dist/index36.mjs +36 -108
- package/dist/index37.js +98 -10
- package/dist/index37.mjs +96 -10
- package/dist/index38.js +95 -20
- package/dist/index38.mjs +95 -20
- package/dist/index39.js +23 -44
- package/dist/index39.mjs +23 -43
- package/dist/index4.js +5 -5
- package/dist/index4.mjs +5 -5
- package/dist/index40.js +34 -0
- package/dist/index40.mjs +29 -0
- package/dist/index41.js +14 -0
- package/dist/index41.mjs +10 -0
- package/dist/index42.js +54 -0
- package/dist/index42.mjs +50 -0
- package/dist/index43.js +177 -0
- package/dist/index43.mjs +173 -0
- package/dist/index44.js +947 -0
- package/dist/index44.mjs +943 -0
- package/dist/index45.js +7 -0
- package/dist/index45.mjs +3 -0
- package/dist/index46.js +7 -0
- package/dist/index46.mjs +3 -0
- package/dist/index47.js +19 -0
- package/dist/index47.mjs +15 -0
- package/dist/index48.js +33 -0
- package/dist/index48.mjs +29 -0
- package/dist/index49.js +67 -0
- package/dist/index49.mjs +62 -0
- package/package.json +2 -2
package/dist/index23.mjs
CHANGED
|
@@ -1,65 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { Injectable } from './index36.mjs';
|
|
1
|
+
import { getOwnCustomMetadata } from './index34.mjs';
|
|
2
|
+
import { ParameterDecoratorFactory } from './index17.mjs';
|
|
3
|
+
import { getParamValueKey } from './index25.mjs';
|
|
4
|
+
import { ResolverStore } from './index35.mjs';
|
|
6
5
|
|
|
7
|
-
class
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
if (!this.injectables.has(e)) {
|
|
27
|
-
throw new Error(`Class with identifier '${e.name}' has not been registered or is a circular dependency.`);
|
|
28
|
-
}
|
|
29
|
-
const i = this.injectables.get(e);
|
|
30
|
-
if (i.isSingleton) {
|
|
31
|
-
return this.singletonStrategy.resolve(i, t);
|
|
32
|
-
} else {
|
|
33
|
-
return this.transientStrategy.resolve(i, t);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
concrete(e) {
|
|
37
|
-
const t = this.injectables.get(e);
|
|
38
|
-
if (t) return t.concrete;
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
tagged(...e) {
|
|
42
|
-
const t = [];
|
|
43
|
-
for (const i of e){
|
|
44
|
-
for (const [e, s] of this.injectables){
|
|
45
|
-
if (s.tags.includes(i)) t.push(s.build());
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return t;
|
|
49
|
-
}
|
|
50
|
-
dispose() {
|
|
51
|
-
for (const [e, t] of this.injectables){
|
|
52
|
-
t.dispose();
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
get size() {
|
|
56
|
-
return this.injectables.size;
|
|
57
|
-
}
|
|
58
|
-
constructor(){
|
|
59
|
-
this.injectables = new Map();
|
|
60
|
-
this.singletonStrategy = new SingletonStrategy();
|
|
61
|
-
this.transientStrategy = new TransientStrategy();
|
|
62
|
-
}
|
|
63
|
-
}
|
|
6
|
+
let GlobalResolver = class GlobalResolver {
|
|
7
|
+
resolve(e, r, a) {
|
|
8
|
+
const t = getOwnCustomMetadata(getParamValueKey('Global'), a);
|
|
9
|
+
const s = t[e];
|
|
10
|
+
return r.privateContext.global(s);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
const decorateGlobal = (o, e, r)=>{
|
|
14
|
+
Global(o)(e, undefined, r);
|
|
15
|
+
};
|
|
16
|
+
const Global = (()=>{
|
|
17
|
+
ResolverStore.register('Global', GlobalResolver);
|
|
18
|
+
return ParameterDecoratorFactory.create({
|
|
19
|
+
name: 'Global',
|
|
20
|
+
valueType: 'map',
|
|
21
|
+
resolver: GlobalResolver,
|
|
22
|
+
handler: decorateGlobal
|
|
23
|
+
});
|
|
24
|
+
})();
|
|
64
25
|
|
|
65
|
-
export {
|
|
26
|
+
export { Global, decorateGlobal };
|
package/dist/index24.js
CHANGED
|
@@ -2,36 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
return this.objects.get(e);
|
|
21
|
-
}
|
|
22
|
-
addGlobal(e, t) {
|
|
23
|
-
if (this.globals.has(e)) {
|
|
24
|
-
throw new Error(`Global value with key '${e}' has already been registered.`);
|
|
5
|
+
const reflection = require('./index34.js');
|
|
6
|
+
const parameterDecoratorFactory = require('./index17.js');
|
|
7
|
+
const helpers = require('./index25.js');
|
|
8
|
+
const resolverStore = require('./index35.js');
|
|
9
|
+
|
|
10
|
+
let OptionalResolver = class OptionalResolver {
|
|
11
|
+
resolve(o, t, n) {
|
|
12
|
+
try {
|
|
13
|
+
const r = reflection.getParamTypes(n);
|
|
14
|
+
const a = r[o];
|
|
15
|
+
return t.privateContext.require(a);
|
|
16
|
+
} catch {
|
|
17
|
+
const e = reflection.getOwnCustomMetadata(helpers.getParamValueKey('Optional'), n);
|
|
18
|
+
return e?.[o];
|
|
25
19
|
}
|
|
26
|
-
this.globals.set(e, t);
|
|
27
|
-
}
|
|
28
|
-
global(e) {
|
|
29
|
-
return this.globals.get(e);
|
|
30
|
-
}
|
|
31
|
-
constructor(){
|
|
32
|
-
this.objects = new Map();
|
|
33
|
-
this.globals = new Map();
|
|
34
20
|
}
|
|
35
|
-
}
|
|
21
|
+
};
|
|
22
|
+
const Optional = (()=>{
|
|
23
|
+
resolverStore.ResolverStore.register('Optional', OptionalResolver);
|
|
24
|
+
return parameterDecoratorFactory.ParameterDecoratorFactory.create({
|
|
25
|
+
name: 'Optional',
|
|
26
|
+
valueType: 'map',
|
|
27
|
+
resolver: OptionalResolver
|
|
28
|
+
});
|
|
29
|
+
})();
|
|
36
30
|
|
|
37
|
-
exports.
|
|
31
|
+
exports.Optional = Optional;
|
package/dist/index24.mjs
CHANGED
|
@@ -1,33 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
return this.objects.get(e);
|
|
17
|
-
}
|
|
18
|
-
addGlobal(e, t) {
|
|
19
|
-
if (this.globals.has(e)) {
|
|
20
|
-
throw new Error(`Global value with key '${e}' has already been registered.`);
|
|
1
|
+
import { getParamTypes, getOwnCustomMetadata } from './index34.mjs';
|
|
2
|
+
import { ParameterDecoratorFactory } from './index17.mjs';
|
|
3
|
+
import { getParamValueKey } from './index25.mjs';
|
|
4
|
+
import { ResolverStore } from './index35.mjs';
|
|
5
|
+
|
|
6
|
+
let OptionalResolver = class OptionalResolver {
|
|
7
|
+
resolve(o, t, n) {
|
|
8
|
+
try {
|
|
9
|
+
const r = getParamTypes(n);
|
|
10
|
+
const a = r[o];
|
|
11
|
+
return t.privateContext.require(a);
|
|
12
|
+
} catch {
|
|
13
|
+
const e = getOwnCustomMetadata(getParamValueKey('Optional'), n);
|
|
14
|
+
return e?.[o];
|
|
21
15
|
}
|
|
22
|
-
this.globals.set(e, t);
|
|
23
|
-
}
|
|
24
|
-
global(e) {
|
|
25
|
-
return this.globals.get(e);
|
|
26
|
-
}
|
|
27
|
-
constructor(){
|
|
28
|
-
this.objects = new Map();
|
|
29
|
-
this.globals = new Map();
|
|
30
16
|
}
|
|
31
|
-
}
|
|
17
|
+
};
|
|
18
|
+
const Optional = (()=>{
|
|
19
|
+
ResolverStore.register('Optional', OptionalResolver);
|
|
20
|
+
return ParameterDecoratorFactory.create({
|
|
21
|
+
name: 'Optional',
|
|
22
|
+
valueType: 'map',
|
|
23
|
+
resolver: OptionalResolver
|
|
24
|
+
});
|
|
25
|
+
})();
|
|
32
26
|
|
|
33
|
-
export {
|
|
27
|
+
export { Optional };
|
package/dist/index25.js
CHANGED
|
@@ -2,70 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const reflection = require('./index34.js');
|
|
6
|
+
const parameterDecoratorFactory = require('./index17.js');
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
callInitedHooks(e) {
|
|
21
|
-
for (const t of [
|
|
22
|
-
...this.initCache
|
|
23
|
-
].reverse()){
|
|
24
|
-
HookManager.callHookImmediate(t.instance, 'onInited', e, t.configuration);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
clearCache() {
|
|
28
|
-
this.initCache.length = 0;
|
|
29
|
-
}
|
|
30
|
-
getCache() {
|
|
31
|
-
return this.initCache;
|
|
32
|
-
}
|
|
33
|
-
constructor(){
|
|
34
|
-
this.initCache = [];
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
HookManager.callHook = (t, i, o, n)=>{
|
|
38
|
-
return new Promise((a, c)=>{
|
|
39
|
-
const r = t[i];
|
|
40
|
-
if (r) {
|
|
41
|
-
if (core.isAsync(r)) {
|
|
42
|
-
r.bind(t)(o, n).then(()=>{
|
|
43
|
-
a();
|
|
44
|
-
}).catch((e)=>{
|
|
45
|
-
c(e);
|
|
46
|
-
});
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
try {
|
|
50
|
-
r.bind(t)(o, n);
|
|
51
|
-
a();
|
|
52
|
-
} catch (e) {
|
|
53
|
-
c(e);
|
|
54
|
-
}
|
|
55
|
-
} else {
|
|
56
|
-
a();
|
|
57
|
-
}
|
|
58
|
-
});
|
|
8
|
+
const getParamIndexKey = (e)=>{
|
|
9
|
+
return `assemblage:${e.toLowerCase()}.param.index`;
|
|
10
|
+
};
|
|
11
|
+
const getParamValueKey = (e)=>{
|
|
12
|
+
return `assemblage:${e.toLowerCase()}.param.value`;
|
|
13
|
+
};
|
|
14
|
+
const getParameterIndexes = (r, t)=>{
|
|
15
|
+
return reflection.getOwnCustomMetadata(getParamIndexKey(r), t) || [];
|
|
16
|
+
};
|
|
17
|
+
const getParameterValues = (r, t)=>{
|
|
18
|
+
return reflection.getOwnCustomMetadata(getParamValueKey(r), t);
|
|
59
19
|
};
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
a.bind(t)(o, n);
|
|
20
|
+
const getDecoratedParametersIndexes = (e)=>{
|
|
21
|
+
const t = parameterDecoratorFactory.ParameterDecoratorFactory.getRegisteredDecorators();
|
|
22
|
+
const a = {};
|
|
23
|
+
for (const r of t){
|
|
24
|
+
a[r] = getParameterIndexes(r, e);
|
|
68
25
|
}
|
|
26
|
+
return a;
|
|
69
27
|
};
|
|
70
28
|
|
|
71
|
-
exports.
|
|
29
|
+
exports.getDecoratedParametersIndexes = getDecoratedParametersIndexes;
|
|
30
|
+
exports.getParamIndexKey = getParamIndexKey;
|
|
31
|
+
exports.getParamValueKey = getParamValueKey;
|
|
32
|
+
exports.getParameterIndexes = getParameterIndexes;
|
|
33
|
+
exports.getParameterValues = getParameterValues;
|
package/dist/index25.mjs
CHANGED
|
@@ -1,67 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getOwnCustomMetadata } from './index34.mjs';
|
|
2
|
+
import { ParameterDecoratorFactory } from './index17.mjs';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
callInitedHooks(e) {
|
|
17
|
-
for (const t of [
|
|
18
|
-
...this.initCache
|
|
19
|
-
].reverse()){
|
|
20
|
-
HookManager.callHookImmediate(t.instance, 'onInited', e, t.configuration);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
clearCache() {
|
|
24
|
-
this.initCache.length = 0;
|
|
25
|
-
}
|
|
26
|
-
getCache() {
|
|
27
|
-
return this.initCache;
|
|
28
|
-
}
|
|
29
|
-
constructor(){
|
|
30
|
-
this.initCache = [];
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
HookManager.callHook = (t, i, o, n)=>{
|
|
34
|
-
return new Promise((a, c)=>{
|
|
35
|
-
const r = t[i];
|
|
36
|
-
if (r) {
|
|
37
|
-
if (isAsync(r)) {
|
|
38
|
-
r.bind(t)(o, n).then(()=>{
|
|
39
|
-
a();
|
|
40
|
-
}).catch((e)=>{
|
|
41
|
-
c(e);
|
|
42
|
-
});
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
try {
|
|
46
|
-
r.bind(t)(o, n);
|
|
47
|
-
a();
|
|
48
|
-
} catch (e) {
|
|
49
|
-
c(e);
|
|
50
|
-
}
|
|
51
|
-
} else {
|
|
52
|
-
a();
|
|
53
|
-
}
|
|
54
|
-
});
|
|
4
|
+
const getParamIndexKey = (e)=>{
|
|
5
|
+
return `assemblage:${e.toLowerCase()}.param.index`;
|
|
6
|
+
};
|
|
7
|
+
const getParamValueKey = (e)=>{
|
|
8
|
+
return `assemblage:${e.toLowerCase()}.param.value`;
|
|
9
|
+
};
|
|
10
|
+
const getParameterIndexes = (r, t)=>{
|
|
11
|
+
return getOwnCustomMetadata(getParamIndexKey(r), t) || [];
|
|
12
|
+
};
|
|
13
|
+
const getParameterValues = (r, t)=>{
|
|
14
|
+
return getOwnCustomMetadata(getParamValueKey(r), t);
|
|
55
15
|
};
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
a.bind(t)(o, n);
|
|
16
|
+
const getDecoratedParametersIndexes = (e)=>{
|
|
17
|
+
const t = ParameterDecoratorFactory.getRegisteredDecorators();
|
|
18
|
+
const a = {};
|
|
19
|
+
for (const r of t){
|
|
20
|
+
a[r] = getParameterIndexes(r, e);
|
|
64
21
|
}
|
|
22
|
+
return a;
|
|
65
23
|
};
|
|
66
24
|
|
|
67
|
-
export {
|
|
25
|
+
export { getDecoratedParametersIndexes, getParamIndexKey, getParamValueKey, getParameterIndexes, getParameterValues };
|
package/dist/index26.js
CHANGED
|
@@ -2,36 +2,52 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const constants = require('./index28.js');
|
|
6
|
+
const reflection = require('./index34.js');
|
|
7
|
+
const helpers = require('./index25.js');
|
|
8
|
+
const parameterDecoratorFactory = require('./index17.js');
|
|
9
|
+
const decorator = require('./index2.js');
|
|
7
10
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
const createConstructorDecorator = (e)=>{
|
|
12
|
+
return (t)=>ConstructorDecorator(e, t);
|
|
13
|
+
};
|
|
14
|
+
const ConstructorDecorator = (m, i)=>(l)=>{
|
|
15
|
+
const p = class extends l {
|
|
16
|
+
constructor(...e){
|
|
17
|
+
super(...e);
|
|
18
|
+
if (m) m.call(this, i);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(p, 'name', {
|
|
22
|
+
value: l.name
|
|
23
|
+
});
|
|
24
|
+
const u = Reflect.getOwnMetadata(constants.ReflectParamTypes, l) || [];
|
|
25
|
+
const d = helpers.getDecoratedParametersIndexes(l);
|
|
26
|
+
const g = [];
|
|
27
|
+
const h = parameterDecoratorFactory.ParameterDecoratorFactory.getRegisteredDecorators();
|
|
28
|
+
for(let r = 0; r < u.length; r++){
|
|
29
|
+
let o = false;
|
|
30
|
+
for (const s of h){
|
|
31
|
+
if (d[s]?.includes(r)) {
|
|
32
|
+
const a = parameterDecoratorFactory.ParameterDecoratorFactory.getDecoratorHandler(s);
|
|
33
|
+
if (a) {
|
|
34
|
+
const e = reflection.getOwnCustomMetadata(helpers.getParamValueKey(s), l);
|
|
35
|
+
a(e[r], p, r);
|
|
36
|
+
} else {
|
|
37
|
+
const o = reflection.getOwnCustomMetadata(helpers.getParamIndexKey(s), l) || [];
|
|
38
|
+
o.push(r);
|
|
39
|
+
reflection.defineCustomMetadata(helpers.getParamIndexKey(s), o, p);
|
|
40
|
+
}
|
|
41
|
+
o = true;
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (!o && u[r]) {
|
|
46
|
+
g.push(u[r]);
|
|
47
|
+
}
|
|
18
48
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
this.assembler.hookManager.callInitHooks(this.assembler.publicContext);
|
|
22
|
-
const l = o ? {
|
|
23
|
-
...a.configuration,
|
|
24
|
-
...o
|
|
25
|
-
} : a.configuration;
|
|
26
|
-
hookManager.HookManager.callHookImmediate(r, 'onInit', this.assembler.publicContext, l);
|
|
27
|
-
this.assembler.hookManager.callInitedHooks(this.assembler.publicContext);
|
|
28
|
-
hookManager.HookManager.callHookImmediate(r, 'onInited', this.assembler.publicContext, l);
|
|
29
|
-
this.assembler.hookManager.clearCache();
|
|
30
|
-
return r;
|
|
31
|
-
}
|
|
32
|
-
constructor(e){
|
|
33
|
-
this.assembler = e;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
49
|
+
return decorator.decorateAssemblage(p, reflection.getOwnCustomMetadata(constants.ReflectValue.AssemblageDefinition, l));
|
|
50
|
+
};
|
|
36
51
|
|
|
37
|
-
exports.
|
|
52
|
+
exports.ConstructorDecorator = ConstructorDecorator;
|
|
53
|
+
exports.createConstructorDecorator = createConstructorDecorator;
|
package/dist/index26.mjs
CHANGED
|
@@ -1,33 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ReflectParamTypes, ReflectValue } from './index28.mjs';
|
|
2
|
+
import { getOwnCustomMetadata, defineCustomMetadata } from './index34.mjs';
|
|
3
|
+
import { getDecoratedParametersIndexes, getParamValueKey, getParamIndexKey } from './index25.mjs';
|
|
4
|
+
import { ParameterDecoratorFactory } from './index17.mjs';
|
|
5
|
+
import { decorateAssemblage } from './index2.mjs';
|
|
3
6
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
+
}
|
|
14
44
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
this.assembler.hookManager.callInitHooks(this.assembler.publicContext);
|
|
18
|
-
const l = o ? {
|
|
19
|
-
...a.configuration,
|
|
20
|
-
...o
|
|
21
|
-
} : a.configuration;
|
|
22
|
-
HookManager.callHookImmediate(r, 'onInit', this.assembler.publicContext, l);
|
|
23
|
-
this.assembler.hookManager.callInitedHooks(this.assembler.publicContext);
|
|
24
|
-
HookManager.callHookImmediate(r, 'onInited', this.assembler.publicContext, l);
|
|
25
|
-
this.assembler.hookManager.clearCache();
|
|
26
|
-
return r;
|
|
27
|
-
}
|
|
28
|
-
constructor(e){
|
|
29
|
-
this.assembler = e;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
45
|
+
return decorateAssemblage(p, getOwnCustomMetadata(ReflectValue.AssemblageDefinition, l));
|
|
46
|
+
};
|
|
32
47
|
|
|
33
|
-
export {
|
|
48
|
+
export { ConstructorDecorator, createConstructorDecorator };
|
package/dist/index27.js
CHANGED
|
@@ -1,37 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const Reflect = require('./index44.js');
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
createPublicContext() {
|
|
7
|
-
return {
|
|
8
|
-
has: this.assembler.has.bind(this.assembler),
|
|
9
|
-
require: this.assembler.require.bind(this.assembler),
|
|
10
|
-
concrete: this.assembler.concrete.bind(this.assembler),
|
|
11
|
-
tagged: this.assembler.tagged.bind(this.assembler),
|
|
12
|
-
dispose: this.assembler.dispose.bind(this.assembler),
|
|
13
|
-
global: this.assembler.global.bind(this.assembler),
|
|
14
|
-
on: this.assembler.on.bind(this.assembler),
|
|
15
|
-
once: this.assembler.once.bind(this.assembler),
|
|
16
|
-
off: this.assembler.off.bind(this.assembler),
|
|
17
|
-
events: this.assembler.channels
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
createPrivateContext(s) {
|
|
21
|
-
return {
|
|
22
|
-
...s,
|
|
23
|
-
register: this.assembler.register.bind(this.assembler),
|
|
24
|
-
use: this.assembler.use.bind(this.assembler),
|
|
25
|
-
addGlobal: this.assembler.addGlobal.bind(this.assembler),
|
|
26
|
-
prepareInitHook: this.assembler.prepareInitHook.bind(this.assembler),
|
|
27
|
-
emit: this.assembler.emit.bind(this.assembler),
|
|
28
|
-
addChannels: this.assembler.addChannels.bind(this.assembler),
|
|
29
|
-
removeChannels: this.assembler.removeChannels.bind(this.assembler)
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
constructor(s){
|
|
33
|
-
this.assembler = s;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
exports.ContextProvider = ContextProvider;
|
|
5
|
+
Reflect.__require();
|
package/dist/index27.mjs
CHANGED
|
@@ -1,33 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
createPublicContext() {
|
|
3
|
-
return {
|
|
4
|
-
has: this.assembler.has.bind(this.assembler),
|
|
5
|
-
require: this.assembler.require.bind(this.assembler),
|
|
6
|
-
concrete: this.assembler.concrete.bind(this.assembler),
|
|
7
|
-
tagged: this.assembler.tagged.bind(this.assembler),
|
|
8
|
-
dispose: this.assembler.dispose.bind(this.assembler),
|
|
9
|
-
global: this.assembler.global.bind(this.assembler),
|
|
10
|
-
on: this.assembler.on.bind(this.assembler),
|
|
11
|
-
once: this.assembler.once.bind(this.assembler),
|
|
12
|
-
off: this.assembler.off.bind(this.assembler),
|
|
13
|
-
events: this.assembler.channels
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
createPrivateContext(s) {
|
|
17
|
-
return {
|
|
18
|
-
...s,
|
|
19
|
-
register: this.assembler.register.bind(this.assembler),
|
|
20
|
-
use: this.assembler.use.bind(this.assembler),
|
|
21
|
-
addGlobal: this.assembler.addGlobal.bind(this.assembler),
|
|
22
|
-
prepareInitHook: this.assembler.prepareInitHook.bind(this.assembler),
|
|
23
|
-
emit: this.assembler.emit.bind(this.assembler),
|
|
24
|
-
addChannels: this.assembler.addChannels.bind(this.assembler),
|
|
25
|
-
removeChannels: this.assembler.removeChannels.bind(this.assembler)
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
constructor(s){
|
|
29
|
-
this.assembler = s;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
1
|
+
import { __require as require_Reflect } from './index44.mjs';
|
|
32
2
|
|
|
33
|
-
|
|
3
|
+
require_Reflect();
|