assemblerjs 1.1.8 → 1.1.10
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/index18.js +1 -1
- package/dist/index18.mjs +1 -1
- package/dist/index19.js +1 -1
- package/dist/index19.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/index31.js +6 -6
- package/dist/index31.mjs +6 -6
- package/dist/index36.js +36 -14
- package/dist/index36.mjs +36 -14
- package/dist/index37.js +20 -38
- package/dist/index37.mjs +20 -37
- package/dist/index38.js +38 -20
- package/dist/index38.mjs +37 -20
- package/dist/index41.js +49 -29
- package/dist/index41.mjs +49 -28
- package/dist/index43.js +29 -49
- package/dist/index43.mjs +28 -49
- package/dist/index44.js +1 -1
- package/dist/index44.mjs +1 -1
- package/dist/index48.js +1 -1
- package/dist/index48.mjs +1 -1
- package/dist/index49.js +1 -1
- package/dist/index49.mjs +1 -1
- package/package.json +1 -1
package/dist/index18.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
5
|
const parameterDecoratorFactory = require('./index17.js');
|
|
6
|
-
const resolverStore = require('./
|
|
6
|
+
const resolverStore = require('./index37.js');
|
|
7
7
|
|
|
8
8
|
let ContextResolver = class ContextResolver {
|
|
9
9
|
resolve(e, r, t) {
|
package/dist/index18.mjs
CHANGED
package/dist/index19.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
5
|
const parameterDecoratorFactory = require('./index17.js');
|
|
6
|
-
const resolverStore = require('./
|
|
6
|
+
const resolverStore = require('./index37.js');
|
|
7
7
|
|
|
8
8
|
let ConfigurationResolver = class ConfigurationResolver {
|
|
9
9
|
resolve(r, o, e, n) {
|
package/dist/index19.mjs
CHANGED
package/dist/index20.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
5
|
const parameterDecoratorFactory = require('./index17.js');
|
|
6
|
-
const resolverStore = require('./
|
|
6
|
+
const resolverStore = require('./index37.js');
|
|
7
7
|
|
|
8
8
|
let DefinitionResolver = class DefinitionResolver {
|
|
9
9
|
resolve(e, r) {
|
package/dist/index20.mjs
CHANGED
package/dist/index21.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
5
|
const parameterDecoratorFactory = require('./index17.js');
|
|
6
|
-
const resolverStore = require('./
|
|
6
|
+
const resolverStore = require('./index37.js');
|
|
7
7
|
|
|
8
8
|
let DisposeResolver = class DisposeResolver {
|
|
9
9
|
resolve(e, r, s) {
|
package/dist/index21.mjs
CHANGED
package/dist/index22.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
5
5
|
const reflection = require('./index29.js');
|
|
6
6
|
const parameterDecoratorFactory = require('./index17.js');
|
|
7
7
|
const helpers = require('./index25.js');
|
|
8
|
-
const resolverStore = require('./
|
|
8
|
+
const resolverStore = require('./index37.js');
|
|
9
9
|
|
|
10
10
|
let UseResolver = class UseResolver {
|
|
11
11
|
resolve(r, o, t) {
|
package/dist/index22.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getOwnCustomMetadata } from './index29.mjs';
|
|
2
2
|
import { ParameterDecoratorFactory } from './index17.mjs';
|
|
3
3
|
import { getParamValueKey } from './index25.mjs';
|
|
4
|
-
import { ResolverStore } from './
|
|
4
|
+
import { ResolverStore } from './index37.mjs';
|
|
5
5
|
|
|
6
6
|
let UseResolver = class UseResolver {
|
|
7
7
|
resolve(r, o, t) {
|
package/dist/index23.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
5
5
|
const reflection = require('./index29.js');
|
|
6
6
|
const parameterDecoratorFactory = require('./index17.js');
|
|
7
7
|
const helpers = require('./index25.js');
|
|
8
|
-
const resolverStore = require('./
|
|
8
|
+
const resolverStore = require('./index37.js');
|
|
9
9
|
|
|
10
10
|
let GlobalResolver = class GlobalResolver {
|
|
11
11
|
resolve(e, r, a) {
|
package/dist/index23.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getOwnCustomMetadata } from './index29.mjs';
|
|
2
2
|
import { ParameterDecoratorFactory } from './index17.mjs';
|
|
3
3
|
import { getParamValueKey } from './index25.mjs';
|
|
4
|
-
import { ResolverStore } from './
|
|
4
|
+
import { ResolverStore } from './index37.mjs';
|
|
5
5
|
|
|
6
6
|
let GlobalResolver = class GlobalResolver {
|
|
7
7
|
resolve(e, r, a) {
|
package/dist/index24.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
5
5
|
const reflection = require('./index29.js');
|
|
6
6
|
const parameterDecoratorFactory = require('./index17.js');
|
|
7
7
|
const helpers = require('./index25.js');
|
|
8
|
-
const resolverStore = require('./
|
|
8
|
+
const resolverStore = require('./index37.js');
|
|
9
9
|
|
|
10
10
|
let OptionalResolver = class OptionalResolver {
|
|
11
11
|
resolve(o, t, n) {
|
package/dist/index24.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getParamTypes, getOwnCustomMetadata } from './index29.mjs';
|
|
2
2
|
import { ParameterDecoratorFactory } from './index17.mjs';
|
|
3
3
|
import { getParamValueKey } from './index25.mjs';
|
|
4
|
-
import { ResolverStore } from './
|
|
4
|
+
import { ResolverStore } from './index37.mjs';
|
|
5
5
|
|
|
6
6
|
let OptionalResolver = class OptionalResolver {
|
|
7
7
|
resolve(o, t, n) {
|
package/dist/index31.js
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
5
|
const hookManager = require('./index33.js');
|
|
6
|
-
const resolutionStrategies = require('./
|
|
6
|
+
const resolutionStrategies = require('./index43.js');
|
|
7
7
|
const debugLogger = require('./index36.js');
|
|
8
8
|
const core = require('@assemblerjs/core');
|
|
9
9
|
const use = require('./index42.js');
|
|
10
|
-
const inject = require('./
|
|
10
|
+
const inject = require('./index41.js');
|
|
11
11
|
const injectable = require('./index44.js');
|
|
12
12
|
|
|
13
13
|
function a(e) {
|
|
@@ -28,6 +28,10 @@ function a(e) {
|
|
|
28
28
|
if (e.name && typeof e.name === 'string') {
|
|
29
29
|
return e.name;
|
|
30
30
|
}
|
|
31
|
+
const t = e.constructor?.name;
|
|
32
|
+
if (t && t !== 'Object') {
|
|
33
|
+
return t;
|
|
34
|
+
}
|
|
31
35
|
try {
|
|
32
36
|
const t = JSON.stringify(e);
|
|
33
37
|
if (t.length > 100) {
|
|
@@ -35,10 +39,6 @@ function a(e) {
|
|
|
35
39
|
}
|
|
36
40
|
return t;
|
|
37
41
|
} catch {
|
|
38
|
-
const t = e.constructor?.name;
|
|
39
|
-
if (t && t !== 'Object') {
|
|
40
|
-
return `[${t}]`;
|
|
41
|
-
}
|
|
42
42
|
return '[UnknownObject]';
|
|
43
43
|
}
|
|
44
44
|
}
|
package/dist/index31.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { HookManager } from './index33.mjs';
|
|
2
|
-
import { SingletonStrategy, TransientStrategy } from './
|
|
2
|
+
import { SingletonStrategy, TransientStrategy } from './index43.mjs';
|
|
3
3
|
import { DebugLogger } from './index36.mjs';
|
|
4
4
|
import { isClass } from '@assemblerjs/core';
|
|
5
5
|
import { resolveInstanceInjectionTuple } from './index42.mjs';
|
|
6
|
-
import { resolveInjectionTuple } from './
|
|
6
|
+
import { resolveInjectionTuple } from './index41.mjs';
|
|
7
7
|
import { Injectable } from './index44.mjs';
|
|
8
8
|
|
|
9
9
|
function a(e) {
|
|
@@ -24,6 +24,10 @@ function a(e) {
|
|
|
24
24
|
if (e.name && typeof e.name === 'string') {
|
|
25
25
|
return e.name;
|
|
26
26
|
}
|
|
27
|
+
const t = e.constructor?.name;
|
|
28
|
+
if (t && t !== 'Object') {
|
|
29
|
+
return t;
|
|
30
|
+
}
|
|
27
31
|
try {
|
|
28
32
|
const t = JSON.stringify(e);
|
|
29
33
|
if (t.length > 100) {
|
|
@@ -31,10 +35,6 @@ function a(e) {
|
|
|
31
35
|
}
|
|
32
36
|
return t;
|
|
33
37
|
} catch {
|
|
34
|
-
const t = e.constructor?.name;
|
|
35
|
-
if (t && t !== 'Object') {
|
|
36
|
-
return `[${t}]`;
|
|
37
|
-
}
|
|
38
38
|
return '[UnknownObject]';
|
|
39
39
|
}
|
|
40
40
|
}
|
package/dist/index36.js
CHANGED
|
@@ -2,6 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
+
function o(o) {
|
|
6
|
+
if (o === undefined) return 'undefined';
|
|
7
|
+
if (o === null) return 'null';
|
|
8
|
+
if (typeof o === 'function') {
|
|
9
|
+
if (o.name) return o.name;
|
|
10
|
+
if (o.constructor?.name && o.constructor.name !== 'Function') {
|
|
11
|
+
return o.constructor.name;
|
|
12
|
+
}
|
|
13
|
+
return 'AnonymousFunction';
|
|
14
|
+
}
|
|
15
|
+
if (typeof o === 'object') {
|
|
16
|
+
if (o.name && typeof o.name === 'string') {
|
|
17
|
+
return o.name;
|
|
18
|
+
}
|
|
19
|
+
const e = o.constructor?.name;
|
|
20
|
+
if (e && e !== 'Object') {
|
|
21
|
+
return e;
|
|
22
|
+
}
|
|
23
|
+
return '[Object]';
|
|
24
|
+
}
|
|
25
|
+
return String(o);
|
|
26
|
+
}
|
|
5
27
|
let NoOpDebugLogger = class NoOpDebugLogger {
|
|
6
28
|
configure(o) {}
|
|
7
29
|
log(o, e, t) {}
|
|
@@ -46,18 +68,18 @@ let ActiveDebugLogger = class ActiveDebugLogger {
|
|
|
46
68
|
tags: o.tags
|
|
47
69
|
});
|
|
48
70
|
}
|
|
49
|
-
logHook(
|
|
71
|
+
logHook(e, t, n) {
|
|
50
72
|
if (!this.shouldLog('hooks')) return;
|
|
51
|
-
const
|
|
52
|
-
this.log('info', `Hook: ${
|
|
53
|
-
target:
|
|
54
|
-
config:
|
|
73
|
+
const i = this.options.logTimings ? performance.now() : 0;
|
|
74
|
+
this.log('info', `Hook: ${e}`, {
|
|
75
|
+
target: o(t),
|
|
76
|
+
config: n
|
|
55
77
|
});
|
|
56
78
|
if (this.options.logTimings) {
|
|
57
79
|
return ()=>{
|
|
58
|
-
const
|
|
59
|
-
this.log('info', `Hook: ${
|
|
60
|
-
duration: `${
|
|
80
|
+
const o = performance.now() - i;
|
|
81
|
+
this.log('info', `Hook: ${e} completed`, {
|
|
82
|
+
duration: `${o.toFixed(2)}ms`
|
|
61
83
|
});
|
|
62
84
|
};
|
|
63
85
|
}
|
|
@@ -89,10 +111,10 @@ let ActiveDebugLogger = class ActiveDebugLogger {
|
|
|
89
111
|
if (this.options.logger) {
|
|
90
112
|
this.options.logger(o, e, t);
|
|
91
113
|
} else {
|
|
92
|
-
const
|
|
93
|
-
const i = this.options.useColors !== false ? this.colorize(o,
|
|
94
|
-
const
|
|
95
|
-
console.log(`${i} ${e}${
|
|
114
|
+
const n = `[Assembler:${o}]`;
|
|
115
|
+
const i = this.options.useColors !== false ? this.colorize(o, n) : n;
|
|
116
|
+
const s = t ? ` ${JSON.stringify(t)}` : '';
|
|
117
|
+
console.log(`${i} ${e}${s}`);
|
|
96
118
|
}
|
|
97
119
|
}
|
|
98
120
|
colorize(o, e) {
|
|
@@ -102,8 +124,8 @@ let ActiveDebugLogger = class ActiveDebugLogger {
|
|
|
102
124
|
error: '\x1b[31m',
|
|
103
125
|
reset: '\x1b[0m'
|
|
104
126
|
};
|
|
105
|
-
const
|
|
106
|
-
return `${
|
|
127
|
+
const n = t[o] || t.info;
|
|
128
|
+
return `${n}${e}${t.reset}`;
|
|
107
129
|
}
|
|
108
130
|
constructor(){
|
|
109
131
|
this.options = {
|
package/dist/index36.mjs
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
function o(o) {
|
|
2
|
+
if (o === undefined) return 'undefined';
|
|
3
|
+
if (o === null) return 'null';
|
|
4
|
+
if (typeof o === 'function') {
|
|
5
|
+
if (o.name) return o.name;
|
|
6
|
+
if (o.constructor?.name && o.constructor.name !== 'Function') {
|
|
7
|
+
return o.constructor.name;
|
|
8
|
+
}
|
|
9
|
+
return 'AnonymousFunction';
|
|
10
|
+
}
|
|
11
|
+
if (typeof o === 'object') {
|
|
12
|
+
if (o.name && typeof o.name === 'string') {
|
|
13
|
+
return o.name;
|
|
14
|
+
}
|
|
15
|
+
const e = o.constructor?.name;
|
|
16
|
+
if (e && e !== 'Object') {
|
|
17
|
+
return e;
|
|
18
|
+
}
|
|
19
|
+
return '[Object]';
|
|
20
|
+
}
|
|
21
|
+
return String(o);
|
|
22
|
+
}
|
|
1
23
|
let NoOpDebugLogger = class NoOpDebugLogger {
|
|
2
24
|
configure(o) {}
|
|
3
25
|
log(o, e, t) {}
|
|
@@ -42,18 +64,18 @@ let ActiveDebugLogger = class ActiveDebugLogger {
|
|
|
42
64
|
tags: o.tags
|
|
43
65
|
});
|
|
44
66
|
}
|
|
45
|
-
logHook(
|
|
67
|
+
logHook(e, t, n) {
|
|
46
68
|
if (!this.shouldLog('hooks')) return;
|
|
47
|
-
const
|
|
48
|
-
this.log('info', `Hook: ${
|
|
49
|
-
target:
|
|
50
|
-
config:
|
|
69
|
+
const i = this.options.logTimings ? performance.now() : 0;
|
|
70
|
+
this.log('info', `Hook: ${e}`, {
|
|
71
|
+
target: o(t),
|
|
72
|
+
config: n
|
|
51
73
|
});
|
|
52
74
|
if (this.options.logTimings) {
|
|
53
75
|
return ()=>{
|
|
54
|
-
const
|
|
55
|
-
this.log('info', `Hook: ${
|
|
56
|
-
duration: `${
|
|
76
|
+
const o = performance.now() - i;
|
|
77
|
+
this.log('info', `Hook: ${e} completed`, {
|
|
78
|
+
duration: `${o.toFixed(2)}ms`
|
|
57
79
|
});
|
|
58
80
|
};
|
|
59
81
|
}
|
|
@@ -85,10 +107,10 @@ let ActiveDebugLogger = class ActiveDebugLogger {
|
|
|
85
107
|
if (this.options.logger) {
|
|
86
108
|
this.options.logger(o, e, t);
|
|
87
109
|
} else {
|
|
88
|
-
const
|
|
89
|
-
const i = this.options.useColors !== false ? this.colorize(o,
|
|
90
|
-
const
|
|
91
|
-
console.log(`${i} ${e}${
|
|
110
|
+
const n = `[Assembler:${o}]`;
|
|
111
|
+
const i = this.options.useColors !== false ? this.colorize(o, n) : n;
|
|
112
|
+
const s = t ? ` ${JSON.stringify(t)}` : '';
|
|
113
|
+
console.log(`${i} ${e}${s}`);
|
|
92
114
|
}
|
|
93
115
|
}
|
|
94
116
|
colorize(o, e) {
|
|
@@ -98,8 +120,8 @@ let ActiveDebugLogger = class ActiveDebugLogger {
|
|
|
98
120
|
error: '\x1b[31m',
|
|
99
121
|
reset: '\x1b[0m'
|
|
100
122
|
};
|
|
101
|
-
const
|
|
102
|
-
return `${
|
|
123
|
+
const n = t[o] || t.info;
|
|
124
|
+
return `${n}${e}${t.reset}`;
|
|
103
125
|
}
|
|
104
126
|
constructor(){
|
|
105
127
|
this.options = {
|
package/dist/index37.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/index37.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/index38.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/index38.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/index41.js
CHANGED
|
@@ -2,33 +2,53 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
resolve(t, e) {
|
|
7
|
-
const n = t.identifier;
|
|
8
|
-
if (this.cache.has(n)) {
|
|
9
|
-
return this.cache.get(n);
|
|
10
|
-
}
|
|
11
|
-
const o = t.build(e);
|
|
12
|
-
const r = e ? {
|
|
13
|
-
...t.configuration,
|
|
14
|
-
...e
|
|
15
|
-
} : t.configuration;
|
|
16
|
-
t.setSingletonInstance(o, r);
|
|
17
|
-
this.cache.set(n, o);
|
|
18
|
-
t.privateContext.prepareInitHook(o, t.configuration);
|
|
19
|
-
return o;
|
|
20
|
-
}
|
|
21
|
-
constructor(){
|
|
22
|
-
this.cache = new Map();
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
class TransientStrategy {
|
|
26
|
-
resolve(t, e) {
|
|
27
|
-
const n = t.build(e);
|
|
28
|
-
t.privateContext.prepareInitHook(n, t.configuration);
|
|
29
|
-
return n;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
5
|
+
const core = require('@assemblerjs/core');
|
|
32
6
|
|
|
33
|
-
|
|
34
|
-
|
|
7
|
+
const i = (e)=>{
|
|
8
|
+
return {
|
|
9
|
+
identifier: e[0],
|
|
10
|
+
concrete: e[0],
|
|
11
|
+
configuration: {}
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
const c = (o)=>{
|
|
15
|
+
const i = ()=>core.isClass(o[0]) && core.isClass(o[1]);
|
|
16
|
+
const c = ()=>core.isClass(o[0]) && core.isObject(o[1]);
|
|
17
|
+
const s = ()=>core.pipe(core.conditionally({
|
|
18
|
+
if: ()=>i(),
|
|
19
|
+
then: ()=>{
|
|
20
|
+
return {
|
|
21
|
+
identifier: o[0],
|
|
22
|
+
concrete: o[1],
|
|
23
|
+
configuration: {}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
}), core.conditionally({
|
|
27
|
+
if: ()=>c(),
|
|
28
|
+
then: ()=>{
|
|
29
|
+
return {
|
|
30
|
+
identifier: o[0],
|
|
31
|
+
concrete: o[0],
|
|
32
|
+
configuration: o[1]
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
else: (e)=>e
|
|
36
|
+
}))();
|
|
37
|
+
return s();
|
|
38
|
+
};
|
|
39
|
+
const s = (e)=>{
|
|
40
|
+
return {
|
|
41
|
+
identifier: e[0],
|
|
42
|
+
concrete: e[1],
|
|
43
|
+
configuration: e[2]
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
const resolveInjectionTuple = (e)=>core.switchCase({
|
|
47
|
+
1: ()=>i(e),
|
|
48
|
+
2: ()=>c(e),
|
|
49
|
+
3: ()=>s(e)
|
|
50
|
+
}, ()=>{
|
|
51
|
+
throw new Error(`Injection tuple must be of length 1, 2 or 3.`);
|
|
52
|
+
})(e.length);
|
|
53
|
+
|
|
54
|
+
exports.resolveInjectionTuple = resolveInjectionTuple;
|
package/dist/index41.mjs
CHANGED
|
@@ -1,29 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
resolve(t, e) {
|
|
3
|
-
const n = t.identifier;
|
|
4
|
-
if (this.cache.has(n)) {
|
|
5
|
-
return this.cache.get(n);
|
|
6
|
-
}
|
|
7
|
-
const o = t.build(e);
|
|
8
|
-
const r = e ? {
|
|
9
|
-
...t.configuration,
|
|
10
|
-
...e
|
|
11
|
-
} : t.configuration;
|
|
12
|
-
t.setSingletonInstance(o, r);
|
|
13
|
-
this.cache.set(n, o);
|
|
14
|
-
t.privateContext.prepareInitHook(o, t.configuration);
|
|
15
|
-
return o;
|
|
16
|
-
}
|
|
17
|
-
constructor(){
|
|
18
|
-
this.cache = new Map();
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
class TransientStrategy {
|
|
22
|
-
resolve(t, e) {
|
|
23
|
-
const n = t.build(e);
|
|
24
|
-
t.privateContext.prepareInitHook(n, t.configuration);
|
|
25
|
-
return n;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
1
|
+
import { switchCase, pipe, conditionally, isClass, isObject } from '@assemblerjs/core';
|
|
28
2
|
|
|
29
|
-
|
|
3
|
+
const i = (e)=>{
|
|
4
|
+
return {
|
|
5
|
+
identifier: e[0],
|
|
6
|
+
concrete: e[0],
|
|
7
|
+
configuration: {}
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
const c = (o)=>{
|
|
11
|
+
const i = ()=>isClass(o[0]) && isClass(o[1]);
|
|
12
|
+
const c = ()=>isClass(o[0]) && isObject(o[1]);
|
|
13
|
+
const s = ()=>pipe(conditionally({
|
|
14
|
+
if: ()=>i(),
|
|
15
|
+
then: ()=>{
|
|
16
|
+
return {
|
|
17
|
+
identifier: o[0],
|
|
18
|
+
concrete: o[1],
|
|
19
|
+
configuration: {}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}), conditionally({
|
|
23
|
+
if: ()=>c(),
|
|
24
|
+
then: ()=>{
|
|
25
|
+
return {
|
|
26
|
+
identifier: o[0],
|
|
27
|
+
concrete: o[0],
|
|
28
|
+
configuration: o[1]
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
else: (e)=>e
|
|
32
|
+
}))();
|
|
33
|
+
return s();
|
|
34
|
+
};
|
|
35
|
+
const s = (e)=>{
|
|
36
|
+
return {
|
|
37
|
+
identifier: e[0],
|
|
38
|
+
concrete: e[1],
|
|
39
|
+
configuration: e[2]
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
const resolveInjectionTuple = (e)=>switchCase({
|
|
43
|
+
1: ()=>i(e),
|
|
44
|
+
2: ()=>c(e),
|
|
45
|
+
3: ()=>s(e)
|
|
46
|
+
}, ()=>{
|
|
47
|
+
throw new Error(`Injection tuple must be of length 1, 2 or 3.`);
|
|
48
|
+
})(e.length);
|
|
49
|
+
|
|
50
|
+
export { resolveInjectionTuple };
|
package/dist/index43.js
CHANGED
|
@@ -2,53 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
class SingletonStrategy {
|
|
6
|
+
resolve(t, e) {
|
|
7
|
+
const n = t.identifier;
|
|
8
|
+
if (this.cache.has(n)) {
|
|
9
|
+
return this.cache.get(n);
|
|
10
|
+
}
|
|
11
|
+
const o = t.build(e);
|
|
12
|
+
const r = e ? {
|
|
13
|
+
...t.configuration,
|
|
14
|
+
...e
|
|
15
|
+
} : t.configuration;
|
|
16
|
+
t.setSingletonInstance(o, r);
|
|
17
|
+
this.cache.set(n, o);
|
|
18
|
+
t.privateContext.prepareInitHook(o, t.configuration);
|
|
19
|
+
return o;
|
|
20
|
+
}
|
|
21
|
+
constructor(){
|
|
22
|
+
this.cache = new Map();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
class TransientStrategy {
|
|
26
|
+
resolve(t, e) {
|
|
27
|
+
const n = t.build(e);
|
|
28
|
+
t.privateContext.prepareInitHook(n, t.configuration);
|
|
29
|
+
return n;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
6
32
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
identifier: e[0],
|
|
10
|
-
concrete: e[0],
|
|
11
|
-
configuration: {}
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
const c = (o)=>{
|
|
15
|
-
const i = ()=>core.isClass(o[0]) && core.isClass(o[1]);
|
|
16
|
-
const c = ()=>core.isClass(o[0]) && core.isObject(o[1]);
|
|
17
|
-
const s = ()=>core.pipe(core.conditionally({
|
|
18
|
-
if: ()=>i(),
|
|
19
|
-
then: ()=>{
|
|
20
|
-
return {
|
|
21
|
-
identifier: o[0],
|
|
22
|
-
concrete: o[1],
|
|
23
|
-
configuration: {}
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
}), core.conditionally({
|
|
27
|
-
if: ()=>c(),
|
|
28
|
-
then: ()=>{
|
|
29
|
-
return {
|
|
30
|
-
identifier: o[0],
|
|
31
|
-
concrete: o[0],
|
|
32
|
-
configuration: o[1]
|
|
33
|
-
};
|
|
34
|
-
},
|
|
35
|
-
else: (e)=>e
|
|
36
|
-
}))();
|
|
37
|
-
return s();
|
|
38
|
-
};
|
|
39
|
-
const s = (e)=>{
|
|
40
|
-
return {
|
|
41
|
-
identifier: e[0],
|
|
42
|
-
concrete: e[1],
|
|
43
|
-
configuration: e[2]
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
const resolveInjectionTuple = (e)=>core.switchCase({
|
|
47
|
-
1: ()=>i(e),
|
|
48
|
-
2: ()=>c(e),
|
|
49
|
-
3: ()=>s(e)
|
|
50
|
-
}, ()=>{
|
|
51
|
-
throw new Error(`Injection tuple must be of length 1, 2 or 3.`);
|
|
52
|
-
})(e.length);
|
|
53
|
-
|
|
54
|
-
exports.resolveInjectionTuple = resolveInjectionTuple;
|
|
33
|
+
exports.SingletonStrategy = SingletonStrategy;
|
|
34
|
+
exports.TransientStrategy = TransientStrategy;
|
package/dist/index43.mjs
CHANGED
|
@@ -1,50 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
class SingletonStrategy {
|
|
2
|
+
resolve(t, e) {
|
|
3
|
+
const n = t.identifier;
|
|
4
|
+
if (this.cache.has(n)) {
|
|
5
|
+
return this.cache.get(n);
|
|
6
|
+
}
|
|
7
|
+
const o = t.build(e);
|
|
8
|
+
const r = e ? {
|
|
9
|
+
...t.configuration,
|
|
10
|
+
...e
|
|
11
|
+
} : t.configuration;
|
|
12
|
+
t.setSingletonInstance(o, r);
|
|
13
|
+
this.cache.set(n, o);
|
|
14
|
+
t.privateContext.prepareInitHook(o, t.configuration);
|
|
15
|
+
return o;
|
|
16
|
+
}
|
|
17
|
+
constructor(){
|
|
18
|
+
this.cache = new Map();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
class TransientStrategy {
|
|
22
|
+
resolve(t, e) {
|
|
23
|
+
const n = t.build(e);
|
|
24
|
+
t.privateContext.prepareInitHook(n, t.configuration);
|
|
25
|
+
return n;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
2
28
|
|
|
3
|
-
|
|
4
|
-
return {
|
|
5
|
-
identifier: e[0],
|
|
6
|
-
concrete: e[0],
|
|
7
|
-
configuration: {}
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
const c = (o)=>{
|
|
11
|
-
const i = ()=>isClass(o[0]) && isClass(o[1]);
|
|
12
|
-
const c = ()=>isClass(o[0]) && isObject(o[1]);
|
|
13
|
-
const s = ()=>pipe(conditionally({
|
|
14
|
-
if: ()=>i(),
|
|
15
|
-
then: ()=>{
|
|
16
|
-
return {
|
|
17
|
-
identifier: o[0],
|
|
18
|
-
concrete: o[1],
|
|
19
|
-
configuration: {}
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
}), conditionally({
|
|
23
|
-
if: ()=>c(),
|
|
24
|
-
then: ()=>{
|
|
25
|
-
return {
|
|
26
|
-
identifier: o[0],
|
|
27
|
-
concrete: o[0],
|
|
28
|
-
configuration: o[1]
|
|
29
|
-
};
|
|
30
|
-
},
|
|
31
|
-
else: (e)=>e
|
|
32
|
-
}))();
|
|
33
|
-
return s();
|
|
34
|
-
};
|
|
35
|
-
const s = (e)=>{
|
|
36
|
-
return {
|
|
37
|
-
identifier: e[0],
|
|
38
|
-
concrete: e[1],
|
|
39
|
-
configuration: e[2]
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
const resolveInjectionTuple = (e)=>switchCase({
|
|
43
|
-
1: ()=>i(e),
|
|
44
|
-
2: ()=>c(e),
|
|
45
|
-
3: ()=>s(e)
|
|
46
|
-
}, ()=>{
|
|
47
|
-
throw new Error(`Injection tuple must be of length 1, 2 or 3.`);
|
|
48
|
-
})(e.length);
|
|
49
|
-
|
|
50
|
-
export { resolveInjectionTuple };
|
|
29
|
+
export { SingletonStrategy, TransientStrategy };
|
package/dist/index44.js
CHANGED
|
@@ -7,7 +7,7 @@ const constants = require('./index28.js');
|
|
|
7
7
|
const reflection = require('./index29.js');
|
|
8
8
|
const injectableBuilder = require('./index49.js');
|
|
9
9
|
const dependencies = require('./index50.js');
|
|
10
|
-
const helpers = require('./
|
|
10
|
+
const helpers = require('./index38.js');
|
|
11
11
|
const hookManager = require('./index33.js');
|
|
12
12
|
const helpers$1 = require('./index3.js');
|
|
13
13
|
const use = require('./index42.js');
|
package/dist/index44.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { ReflectValue } from './index28.mjs';
|
|
|
3
3
|
import { defineCustomMetadata } from './index29.mjs';
|
|
4
4
|
import { InjectableBuilder } from './index49.mjs';
|
|
5
5
|
import { resolveDependencies } from './index50.mjs';
|
|
6
|
-
import { unregisterEvents } from './
|
|
6
|
+
import { unregisterEvents } from './index38.mjs';
|
|
7
7
|
import { HookManager } from './index33.mjs';
|
|
8
8
|
import { isAssemblage } from './index3.mjs';
|
|
9
9
|
import { isFactory } from './index42.mjs';
|
package/dist/index48.js
CHANGED
package/dist/index48.mjs
CHANGED
package/dist/index49.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4
4
|
|
|
5
5
|
const dependencies = require('./index50.js');
|
|
6
6
|
const transversalWeaver = require('./index39.js');
|
|
7
|
-
const helpers = require('./
|
|
7
|
+
const helpers = require('./index38.js');
|
|
8
8
|
|
|
9
9
|
class InjectableBuilder {
|
|
10
10
|
build(i) {
|
package/dist/index49.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "assemblerjs",
|
|
3
3
|
"description": "A general purpose Dependency Injection library for node and browser.",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.10",
|
|
5
5
|
"author": "Benoît LAHOZ <info@benoitlahoz.io>",
|
|
6
6
|
"bugs": "https://github.com/benoitlahoz/assemblerjs/issues",
|
|
7
7
|
"homepage": "https://github.com/benoitlahoz/assemblerjs#README",
|