assemblerjs 1.1.5 → 1.1.7
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 +1 -0
- 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/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 +55 -17
- package/dist/index31.mjs +55 -17
- package/dist/index32.js +24 -17
- package/dist/index32.mjs +24 -17
- package/dist/index38.js +18 -101
- package/dist/index38.mjs +18 -101
- package/dist/index39.js +101 -24
- package/dist/index39.mjs +101 -24
- package/dist/index40.js +24 -18
- package/dist/index40.mjs +24 -18
- 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/index.d.ts
CHANGED
package/dist/index13.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
5
|
const core = require('@assemblerjs/core');
|
|
6
|
-
const pointcutMatcher = require('./
|
|
6
|
+
const pointcutMatcher = require('./index40.js');
|
|
7
7
|
const affect = require('./index12.js');
|
|
8
8
|
const schema = require('./index30.js');
|
|
9
9
|
|
package/dist/index13.mjs
CHANGED
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('./index38.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('./index38.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('./index38.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('./index38.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('./index38.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 './index38.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('./index38.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 './index38.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('./index38.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 './index38.mjs';
|
|
5
5
|
|
|
6
6
|
let OptionalResolver = class OptionalResolver {
|
|
7
7
|
resolve(o, t, n) {
|
package/dist/index31.js
CHANGED
|
@@ -5,18 +5,44 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
5
5
|
const hookManager = require('./index33.js');
|
|
6
6
|
const resolutionStrategies = require('./index43.js');
|
|
7
7
|
const debugLogger = require('./index36.js');
|
|
8
|
+
const core = require('@assemblerjs/core');
|
|
8
9
|
const use = require('./index42.js');
|
|
9
10
|
const inject = require('./index41.js');
|
|
10
11
|
const injectable = require('./index44.js');
|
|
11
12
|
|
|
13
|
+
function c(e) {
|
|
14
|
+
if (e?.name) return e.name;
|
|
15
|
+
if (typeof e === 'string') return e;
|
|
16
|
+
if (typeof e === 'symbol') return e.toString();
|
|
17
|
+
if (typeof e === 'number') return String(e);
|
|
18
|
+
if (typeof e === 'boolean') return String(e);
|
|
19
|
+
if (typeof e === 'object' && e !== null) {
|
|
20
|
+
try {
|
|
21
|
+
const t = JSON.stringify(e);
|
|
22
|
+
if (t.length > 100) {
|
|
23
|
+
return t.substring(0, 100) + '...';
|
|
24
|
+
}
|
|
25
|
+
return t;
|
|
26
|
+
} catch {
|
|
27
|
+
return `[${e.constructor?.name || 'Object'}]`;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return String(e);
|
|
31
|
+
}
|
|
32
|
+
function l(e) {
|
|
33
|
+
if (core.isClass(e)) return 'class';
|
|
34
|
+
if (typeof e === 'string') return 'string';
|
|
35
|
+
if (typeof e === 'symbol') return 'symbol';
|
|
36
|
+
return 'unknown';
|
|
37
|
+
}
|
|
12
38
|
class InjectableManager {
|
|
13
39
|
setContexts(e, t) {
|
|
14
40
|
this.privateContext = e;
|
|
15
41
|
this.publicContext = t;
|
|
16
42
|
}
|
|
17
|
-
register(
|
|
43
|
+
register(i, s = false) {
|
|
18
44
|
const a = debugLogger.DebugLogger.getInstance();
|
|
19
|
-
const c = s === true ? use.resolveInstanceInjectionTuple(
|
|
45
|
+
const c = s === true ? use.resolveInstanceInjectionTuple(i) : inject.resolveInjectionTuple(i);
|
|
20
46
|
if (this.has(c.identifier)) {
|
|
21
47
|
const e = `An assemblage is already registered with identifier '${c.identifier.name}'.`;
|
|
22
48
|
a.log('error', 'Duplicate registration', {
|
|
@@ -36,21 +62,31 @@ class InjectableManager {
|
|
|
36
62
|
has(e) {
|
|
37
63
|
return this.injectables.has(e);
|
|
38
64
|
}
|
|
39
|
-
require(e, t,
|
|
65
|
+
require(e, t, r) {
|
|
40
66
|
if (!this.injectables.has(e)) {
|
|
41
|
-
const t =
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
67
|
+
const t = this.resolvingStack.has(e);
|
|
68
|
+
const n = t ? 'Circular dependency detected' : 'Dependency not registered';
|
|
69
|
+
const i = c(e);
|
|
70
|
+
const s = l(e);
|
|
71
|
+
const a = t ? `Circular dependency detected: '${i}' is already being resolved.` : `Dependency '${i}' has not been registered (Class/Service not found in current assemblies).`;
|
|
72
|
+
debugLogger.DebugLogger.getInstance().log('error', n, {
|
|
73
|
+
identifier: i,
|
|
74
|
+
caller: r ? c(r) : 'unknown',
|
|
75
|
+
type: s,
|
|
76
|
+
error: a
|
|
46
77
|
});
|
|
47
|
-
throw new Error(
|
|
78
|
+
throw new Error(a);
|
|
48
79
|
}
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
80
|
+
const n = this.injectables.get(e);
|
|
81
|
+
this.resolvingStack.add(n.identifier);
|
|
82
|
+
try {
|
|
83
|
+
if (n.isSingleton) {
|
|
84
|
+
return this.singletonStrategy.resolve(n, t);
|
|
85
|
+
} else {
|
|
86
|
+
return this.transientStrategy.resolve(n, t);
|
|
87
|
+
}
|
|
88
|
+
} finally{
|
|
89
|
+
this.resolvingStack.delete(n.identifier);
|
|
54
90
|
}
|
|
55
91
|
}
|
|
56
92
|
concrete(e) {
|
|
@@ -60,9 +96,9 @@ class InjectableManager {
|
|
|
60
96
|
}
|
|
61
97
|
tagged(...e) {
|
|
62
98
|
const t = [];
|
|
63
|
-
for (const
|
|
64
|
-
for (const [e,
|
|
65
|
-
if (
|
|
99
|
+
for (const r of e){
|
|
100
|
+
for (const [e, n] of this.injectables){
|
|
101
|
+
if (n.tags.includes(r)) t.push(n.build());
|
|
66
102
|
}
|
|
67
103
|
}
|
|
68
104
|
return t;
|
|
@@ -71,12 +107,14 @@ class InjectableManager {
|
|
|
71
107
|
for (const [e, t] of this.injectables){
|
|
72
108
|
t.dispose();
|
|
73
109
|
}
|
|
110
|
+
this.resolvingStack.clear();
|
|
74
111
|
}
|
|
75
112
|
get size() {
|
|
76
113
|
return this.injectables.size;
|
|
77
114
|
}
|
|
78
115
|
constructor(){
|
|
79
116
|
this.injectables = new Map();
|
|
117
|
+
this.resolvingStack = new Set();
|
|
80
118
|
this.singletonStrategy = new resolutionStrategies.SingletonStrategy();
|
|
81
119
|
this.transientStrategy = new resolutionStrategies.TransientStrategy();
|
|
82
120
|
}
|
package/dist/index31.mjs
CHANGED
|
@@ -1,18 +1,44 @@
|
|
|
1
1
|
import { HookManager } from './index33.mjs';
|
|
2
2
|
import { SingletonStrategy, TransientStrategy } from './index43.mjs';
|
|
3
3
|
import { DebugLogger } from './index36.mjs';
|
|
4
|
+
import { isClass } from '@assemblerjs/core';
|
|
4
5
|
import { resolveInstanceInjectionTuple } from './index42.mjs';
|
|
5
6
|
import { resolveInjectionTuple } from './index41.mjs';
|
|
6
7
|
import { Injectable } from './index44.mjs';
|
|
7
8
|
|
|
9
|
+
function c(e) {
|
|
10
|
+
if (e?.name) return e.name;
|
|
11
|
+
if (typeof e === 'string') return e;
|
|
12
|
+
if (typeof e === 'symbol') return e.toString();
|
|
13
|
+
if (typeof e === 'number') return String(e);
|
|
14
|
+
if (typeof e === 'boolean') return String(e);
|
|
15
|
+
if (typeof e === 'object' && e !== null) {
|
|
16
|
+
try {
|
|
17
|
+
const t = JSON.stringify(e);
|
|
18
|
+
if (t.length > 100) {
|
|
19
|
+
return t.substring(0, 100) + '...';
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
} catch {
|
|
23
|
+
return `[${e.constructor?.name || 'Object'}]`;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return String(e);
|
|
27
|
+
}
|
|
28
|
+
function l(e) {
|
|
29
|
+
if (isClass(e)) return 'class';
|
|
30
|
+
if (typeof e === 'string') return 'string';
|
|
31
|
+
if (typeof e === 'symbol') return 'symbol';
|
|
32
|
+
return 'unknown';
|
|
33
|
+
}
|
|
8
34
|
class InjectableManager {
|
|
9
35
|
setContexts(e, t) {
|
|
10
36
|
this.privateContext = e;
|
|
11
37
|
this.publicContext = t;
|
|
12
38
|
}
|
|
13
|
-
register(
|
|
39
|
+
register(i, s = false) {
|
|
14
40
|
const a = DebugLogger.getInstance();
|
|
15
|
-
const c = s === true ? resolveInstanceInjectionTuple(
|
|
41
|
+
const c = s === true ? resolveInstanceInjectionTuple(i) : resolveInjectionTuple(i);
|
|
16
42
|
if (this.has(c.identifier)) {
|
|
17
43
|
const e = `An assemblage is already registered with identifier '${c.identifier.name}'.`;
|
|
18
44
|
a.log('error', 'Duplicate registration', {
|
|
@@ -32,21 +58,31 @@ class InjectableManager {
|
|
|
32
58
|
has(e) {
|
|
33
59
|
return this.injectables.has(e);
|
|
34
60
|
}
|
|
35
|
-
require(e, t,
|
|
61
|
+
require(e, t, r) {
|
|
36
62
|
if (!this.injectables.has(e)) {
|
|
37
|
-
const t =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
63
|
+
const t = this.resolvingStack.has(e);
|
|
64
|
+
const n = t ? 'Circular dependency detected' : 'Dependency not registered';
|
|
65
|
+
const i = c(e);
|
|
66
|
+
const s = l(e);
|
|
67
|
+
const a = t ? `Circular dependency detected: '${i}' is already being resolved.` : `Dependency '${i}' has not been registered (Class/Service not found in current assemblies).`;
|
|
68
|
+
DebugLogger.getInstance().log('error', n, {
|
|
69
|
+
identifier: i,
|
|
70
|
+
caller: r ? c(r) : 'unknown',
|
|
71
|
+
type: s,
|
|
72
|
+
error: a
|
|
42
73
|
});
|
|
43
|
-
throw new Error(
|
|
74
|
+
throw new Error(a);
|
|
44
75
|
}
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
76
|
+
const n = this.injectables.get(e);
|
|
77
|
+
this.resolvingStack.add(n.identifier);
|
|
78
|
+
try {
|
|
79
|
+
if (n.isSingleton) {
|
|
80
|
+
return this.singletonStrategy.resolve(n, t);
|
|
81
|
+
} else {
|
|
82
|
+
return this.transientStrategy.resolve(n, t);
|
|
83
|
+
}
|
|
84
|
+
} finally{
|
|
85
|
+
this.resolvingStack.delete(n.identifier);
|
|
50
86
|
}
|
|
51
87
|
}
|
|
52
88
|
concrete(e) {
|
|
@@ -56,9 +92,9 @@ class InjectableManager {
|
|
|
56
92
|
}
|
|
57
93
|
tagged(...e) {
|
|
58
94
|
const t = [];
|
|
59
|
-
for (const
|
|
60
|
-
for (const [e,
|
|
61
|
-
if (
|
|
95
|
+
for (const r of e){
|
|
96
|
+
for (const [e, n] of this.injectables){
|
|
97
|
+
if (n.tags.includes(r)) t.push(n.build());
|
|
62
98
|
}
|
|
63
99
|
}
|
|
64
100
|
return t;
|
|
@@ -67,12 +103,14 @@ class InjectableManager {
|
|
|
67
103
|
for (const [e, t] of this.injectables){
|
|
68
104
|
t.dispose();
|
|
69
105
|
}
|
|
106
|
+
this.resolvingStack.clear();
|
|
70
107
|
}
|
|
71
108
|
get size() {
|
|
72
109
|
return this.injectables.size;
|
|
73
110
|
}
|
|
74
111
|
constructor(){
|
|
75
112
|
this.injectables = new Map();
|
|
113
|
+
this.resolvingStack = new Set();
|
|
76
114
|
this.singletonStrategy = new SingletonStrategy();
|
|
77
115
|
this.transientStrategy = new TransientStrategy();
|
|
78
116
|
}
|
package/dist/index32.js
CHANGED
|
@@ -4,32 +4,39 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4
4
|
|
|
5
5
|
const debugLogger = require('./index36.js');
|
|
6
6
|
|
|
7
|
+
function t(e) {
|
|
8
|
+
return typeof e === 'symbol' ? 'symbol' : 'string';
|
|
9
|
+
}
|
|
7
10
|
class ObjectManager {
|
|
8
|
-
use(
|
|
9
|
-
if (this.has(
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
use(r, o) {
|
|
12
|
+
if (this.has(r)) {
|
|
13
|
+
const o = typeof r === 'symbol' ? r.toString() : String(r);
|
|
14
|
+
const s = `Object/value '${o}' is already registered (cannot register twice).`;
|
|
15
|
+
debugLogger.DebugLogger.getInstance().log('error', 'Duplicate object/value registration', {
|
|
16
|
+
identifier: o,
|
|
17
|
+
type: t(r),
|
|
18
|
+
error: s
|
|
14
19
|
});
|
|
15
|
-
throw new Error(
|
|
20
|
+
throw new Error(s);
|
|
16
21
|
}
|
|
17
|
-
this.objects.set(
|
|
18
|
-
return
|
|
22
|
+
this.objects.set(r, o);
|
|
23
|
+
return o;
|
|
19
24
|
}
|
|
20
25
|
has(e) {
|
|
21
26
|
return this.objects.has(e);
|
|
22
27
|
}
|
|
23
|
-
require(
|
|
24
|
-
if (!this.objects.has(
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
|
29
36
|
});
|
|
30
|
-
throw new Error(
|
|
37
|
+
throw new Error(s);
|
|
31
38
|
}
|
|
32
|
-
return this.objects.get(
|
|
39
|
+
return this.objects.get(r);
|
|
33
40
|
}
|
|
34
41
|
addGlobal(e, t) {
|
|
35
42
|
if (this.globals.has(e)) {
|
package/dist/index32.mjs
CHANGED
|
@@ -1,31 +1,38 @@
|
|
|
1
1
|
import { DebugLogger } from './index36.mjs';
|
|
2
2
|
|
|
3
|
+
function t(e) {
|
|
4
|
+
return typeof e === 'symbol' ? 'symbol' : 'string';
|
|
5
|
+
}
|
|
3
6
|
class ObjectManager {
|
|
4
|
-
use(
|
|
5
|
-
if (this.has(
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
use(r, o) {
|
|
8
|
+
if (this.has(r)) {
|
|
9
|
+
const o = typeof r === 'symbol' ? r.toString() : String(r);
|
|
10
|
+
const s = `Object/value '${o}' is already registered (cannot register twice).`;
|
|
11
|
+
DebugLogger.getInstance().log('error', 'Duplicate object/value registration', {
|
|
12
|
+
identifier: o,
|
|
13
|
+
type: t(r),
|
|
14
|
+
error: s
|
|
10
15
|
});
|
|
11
|
-
throw new Error(
|
|
16
|
+
throw new Error(s);
|
|
12
17
|
}
|
|
13
|
-
this.objects.set(
|
|
14
|
-
return
|
|
18
|
+
this.objects.set(r, o);
|
|
19
|
+
return o;
|
|
15
20
|
}
|
|
16
21
|
has(e) {
|
|
17
22
|
return this.objects.has(e);
|
|
18
23
|
}
|
|
19
|
-
require(
|
|
20
|
-
if (!this.objects.has(
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
|
25
32
|
});
|
|
26
|
-
throw new Error(
|
|
33
|
+
throw new Error(s);
|
|
27
34
|
}
|
|
28
|
-
return this.objects.get(
|
|
35
|
+
return this.objects.get(r);
|
|
29
36
|
}
|
|
30
37
|
addGlobal(e, t) {
|
|
31
38
|
if (this.globals.has(e)) {
|
package/dist/index38.js
CHANGED
|
@@ -2,110 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class TransversalWeaver {
|
|
9
|
-
static weave(n, r, o) {
|
|
10
|
-
const c = transversalManager.TransversalManager.getInstance(o);
|
|
11
|
-
const s = c.getAspectsForTarget(r);
|
|
12
|
-
const a = Object.getPrototypeOf(n);
|
|
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;
|
|
22
|
-
});
|
|
23
|
-
if (s.length === 0 && !f) {
|
|
24
|
-
return n;
|
|
25
|
-
}
|
|
26
|
-
return new Proxy(n, {
|
|
27
|
-
get (t, e, n) {
|
|
28
|
-
const r = Reflect.get(t, e, n);
|
|
29
|
-
if (typeof r !== 'function') {
|
|
30
|
-
return r;
|
|
31
|
-
}
|
|
32
|
-
return function(...n) {
|
|
33
|
-
const o = String(e);
|
|
34
|
-
const a = {
|
|
35
|
-
target: t,
|
|
36
|
-
methodName: o,
|
|
37
|
-
args: n
|
|
38
|
-
};
|
|
39
|
-
const f = c.getAdvicesForJoinPoint(a, s, t, e);
|
|
40
|
-
return TransversalWeaver.executeAdviceChain(f, r, t, n, a);
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
});
|
|
5
|
+
class ResolverStore {
|
|
6
|
+
static register(e, r) {
|
|
7
|
+
this.resolvers.set(e, r);
|
|
44
8
|
}
|
|
45
|
-
static
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
try {
|
|
50
|
-
for (const t of c){
|
|
51
|
-
const e = {
|
|
52
|
-
...o,
|
|
53
|
-
config: t.config
|
|
54
|
-
};
|
|
55
|
-
t.method.call(t.transversalInstance, e);
|
|
56
|
-
}
|
|
57
|
-
let t;
|
|
58
|
-
if (s.length > 0) {
|
|
59
|
-
t = this.buildAroundChain(s, e, n, r, o);
|
|
60
|
-
} else {
|
|
61
|
-
t = e.apply(n, r);
|
|
62
|
-
}
|
|
63
|
-
if (t instanceof Promise) {
|
|
64
|
-
return t.then((t)=>{
|
|
65
|
-
for (const e of a){
|
|
66
|
-
const n = {
|
|
67
|
-
...o,
|
|
68
|
-
result: t
|
|
69
|
-
};
|
|
70
|
-
e.method.call(e.transversalInstance, n);
|
|
71
|
-
}
|
|
72
|
-
return t;
|
|
73
|
-
}).catch((t)=>{
|
|
74
|
-
o.error = t;
|
|
75
|
-
throw t;
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
for (const e of a){
|
|
79
|
-
const n = {
|
|
80
|
-
...o,
|
|
81
|
-
result: t,
|
|
82
|
-
config: e.config
|
|
83
|
-
};
|
|
84
|
-
e.method.call(e.transversalInstance, n);
|
|
85
|
-
}
|
|
86
|
-
return t;
|
|
87
|
-
} catch (t) {
|
|
88
|
-
o.error = t;
|
|
89
|
-
throw t;
|
|
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}`);
|
|
90
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());
|
|
91
21
|
}
|
|
92
|
-
static
|
|
93
|
-
|
|
94
|
-
const s = ()=>{
|
|
95
|
-
if (c < t.length) {
|
|
96
|
-
const e = t[c++];
|
|
97
|
-
const n = {
|
|
98
|
-
...o,
|
|
99
|
-
proceed: s,
|
|
100
|
-
config: e.config
|
|
101
|
-
};
|
|
102
|
-
return e.method.call(e.transversalInstance, n);
|
|
103
|
-
} else {
|
|
104
|
-
return e.apply(n, r);
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
return s();
|
|
22
|
+
static clear() {
|
|
23
|
+
this.resolvers.clear();
|
|
108
24
|
}
|
|
109
25
|
}
|
|
26
|
+
ResolverStore.resolvers = new Map();
|
|
110
27
|
|
|
111
|
-
exports.
|
|
28
|
+
exports.ResolverStore = ResolverStore;
|
package/dist/index38.mjs
CHANGED
|
@@ -1,107 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class TransversalWeaver {
|
|
5
|
-
static weave(n, r, o) {
|
|
6
|
-
const c = TransversalManager.getInstance(o);
|
|
7
|
-
const s = c.getAspectsForTarget(r);
|
|
8
|
-
const a = Object.getPrototypeOf(n);
|
|
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;
|
|
18
|
-
});
|
|
19
|
-
if (s.length === 0 && !f) {
|
|
20
|
-
return n;
|
|
21
|
-
}
|
|
22
|
-
return new Proxy(n, {
|
|
23
|
-
get (t, e, n) {
|
|
24
|
-
const r = Reflect.get(t, e, n);
|
|
25
|
-
if (typeof r !== 'function') {
|
|
26
|
-
return r;
|
|
27
|
-
}
|
|
28
|
-
return function(...n) {
|
|
29
|
-
const o = String(e);
|
|
30
|
-
const a = {
|
|
31
|
-
target: t,
|
|
32
|
-
methodName: o,
|
|
33
|
-
args: n
|
|
34
|
-
};
|
|
35
|
-
const f = c.getAdvicesForJoinPoint(a, s, t, e);
|
|
36
|
-
return TransversalWeaver.executeAdviceChain(f, r, t, n, a);
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
});
|
|
1
|
+
class ResolverStore {
|
|
2
|
+
static register(e, r) {
|
|
3
|
+
this.resolvers.set(e, r);
|
|
40
4
|
}
|
|
41
|
-
static
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
try {
|
|
46
|
-
for (const t of c){
|
|
47
|
-
const e = {
|
|
48
|
-
...o,
|
|
49
|
-
config: t.config
|
|
50
|
-
};
|
|
51
|
-
t.method.call(t.transversalInstance, e);
|
|
52
|
-
}
|
|
53
|
-
let t;
|
|
54
|
-
if (s.length > 0) {
|
|
55
|
-
t = this.buildAroundChain(s, e, n, r, o);
|
|
56
|
-
} else {
|
|
57
|
-
t = e.apply(n, r);
|
|
58
|
-
}
|
|
59
|
-
if (t instanceof Promise) {
|
|
60
|
-
return t.then((t)=>{
|
|
61
|
-
for (const e of a){
|
|
62
|
-
const n = {
|
|
63
|
-
...o,
|
|
64
|
-
result: t
|
|
65
|
-
};
|
|
66
|
-
e.method.call(e.transversalInstance, n);
|
|
67
|
-
}
|
|
68
|
-
return t;
|
|
69
|
-
}).catch((t)=>{
|
|
70
|
-
o.error = t;
|
|
71
|
-
throw t;
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
for (const e of a){
|
|
75
|
-
const n = {
|
|
76
|
-
...o,
|
|
77
|
-
result: t,
|
|
78
|
-
config: e.config
|
|
79
|
-
};
|
|
80
|
-
e.method.call(e.transversalInstance, n);
|
|
81
|
-
}
|
|
82
|
-
return t;
|
|
83
|
-
} catch (t) {
|
|
84
|
-
o.error = t;
|
|
85
|
-
throw t;
|
|
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}`);
|
|
86
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());
|
|
87
17
|
}
|
|
88
|
-
static
|
|
89
|
-
|
|
90
|
-
const s = ()=>{
|
|
91
|
-
if (c < t.length) {
|
|
92
|
-
const e = t[c++];
|
|
93
|
-
const n = {
|
|
94
|
-
...o,
|
|
95
|
-
proceed: s,
|
|
96
|
-
config: e.config
|
|
97
|
-
};
|
|
98
|
-
return e.method.call(e.transversalInstance, n);
|
|
99
|
-
} else {
|
|
100
|
-
return e.apply(n, r);
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
return s();
|
|
18
|
+
static clear() {
|
|
19
|
+
this.resolvers.clear();
|
|
104
20
|
}
|
|
105
21
|
}
|
|
22
|
+
ResolverStore.resolvers = new Map();
|
|
106
23
|
|
|
107
|
-
export {
|
|
24
|
+
export { ResolverStore };
|
package/dist/index39.js
CHANGED
|
@@ -2,33 +2,110 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
const transversalManager = require('./index13.js');
|
|
6
|
+
const affect = require('./index12.js');
|
|
7
|
+
|
|
8
|
+
class TransversalWeaver {
|
|
9
|
+
static weave(n, r, o) {
|
|
10
|
+
const c = transversalManager.TransversalManager.getInstance(o);
|
|
11
|
+
const s = c.getAspectsForTarget(r);
|
|
12
|
+
const a = Object.getPrototypeOf(n);
|
|
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;
|
|
22
|
+
});
|
|
23
|
+
if (s.length === 0 && !f) {
|
|
24
|
+
return n;
|
|
10
25
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
26
|
+
return new Proxy(n, {
|
|
27
|
+
get (t, e, n) {
|
|
28
|
+
const r = Reflect.get(t, e, n);
|
|
29
|
+
if (typeof r !== 'function') {
|
|
30
|
+
return r;
|
|
31
|
+
}
|
|
32
|
+
return function(...n) {
|
|
33
|
+
const o = String(e);
|
|
34
|
+
const a = {
|
|
35
|
+
target: t,
|
|
36
|
+
methodName: o,
|
|
37
|
+
args: n
|
|
38
|
+
};
|
|
39
|
+
const f = c.getAdvicesForJoinPoint(a, s, t, e);
|
|
40
|
+
return TransversalWeaver.executeAdviceChain(f, r, t, n, a);
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
});
|
|
20
44
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
45
|
+
static executeAdviceChain(t, e, n, r, o) {
|
|
46
|
+
const c = t.filter((t)=>t.type === 'before');
|
|
47
|
+
const s = t.filter((t)=>t.type === 'around');
|
|
48
|
+
const a = t.filter((t)=>t.type === 'after');
|
|
49
|
+
try {
|
|
50
|
+
for (const t of c){
|
|
51
|
+
const e = {
|
|
52
|
+
...o,
|
|
53
|
+
config: t.config
|
|
54
|
+
};
|
|
55
|
+
t.method.call(t.transversalInstance, e);
|
|
56
|
+
}
|
|
57
|
+
let t;
|
|
58
|
+
if (s.length > 0) {
|
|
59
|
+
t = this.buildAroundChain(s, e, n, r, o);
|
|
60
|
+
} else {
|
|
61
|
+
t = e.apply(n, r);
|
|
62
|
+
}
|
|
63
|
+
if (t instanceof Promise) {
|
|
64
|
+
return t.then((t)=>{
|
|
65
|
+
for (const e of a){
|
|
66
|
+
const n = {
|
|
67
|
+
...o,
|
|
68
|
+
result: t
|
|
69
|
+
};
|
|
70
|
+
e.method.call(e.transversalInstance, n);
|
|
71
|
+
}
|
|
72
|
+
return t;
|
|
73
|
+
}).catch((t)=>{
|
|
74
|
+
o.error = t;
|
|
75
|
+
throw t;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
for (const e of a){
|
|
79
|
+
const n = {
|
|
80
|
+
...o,
|
|
81
|
+
result: t,
|
|
82
|
+
config: e.config
|
|
83
|
+
};
|
|
84
|
+
e.method.call(e.transversalInstance, n);
|
|
85
|
+
}
|
|
86
|
+
return t;
|
|
87
|
+
} catch (t) {
|
|
88
|
+
o.error = t;
|
|
89
|
+
throw t;
|
|
24
90
|
}
|
|
25
|
-
const e = t.replace(/[.+?^${}()|[\]\\]/g, '\\$&').replace(/\*/g, '.*');
|
|
26
|
-
return new RegExp(`^${e}$`);
|
|
27
91
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
92
|
+
static buildAroundChain(t, e, n, r, o) {
|
|
93
|
+
let c = 0;
|
|
94
|
+
const s = ()=>{
|
|
95
|
+
if (c < t.length) {
|
|
96
|
+
const e = t[c++];
|
|
97
|
+
const n = {
|
|
98
|
+
...o,
|
|
99
|
+
proceed: s,
|
|
100
|
+
config: e.config
|
|
101
|
+
};
|
|
102
|
+
return e.method.call(e.transversalInstance, n);
|
|
103
|
+
} else {
|
|
104
|
+
return e.apply(n, r);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
return s();
|
|
31
108
|
}
|
|
32
|
-
}
|
|
109
|
+
}
|
|
33
110
|
|
|
34
|
-
exports.
|
|
111
|
+
exports.TransversalWeaver = TransversalWeaver;
|
package/dist/index39.mjs
CHANGED
|
@@ -1,30 +1,107 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { TransversalManager } from './index13.mjs';
|
|
2
|
+
import { getAffectedMethods } from './index12.mjs';
|
|
3
|
+
|
|
4
|
+
class TransversalWeaver {
|
|
5
|
+
static weave(n, r, o) {
|
|
6
|
+
const c = TransversalManager.getInstance(o);
|
|
7
|
+
const s = c.getAspectsForTarget(r);
|
|
8
|
+
const a = Object.getPrototypeOf(n);
|
|
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;
|
|
18
|
+
});
|
|
19
|
+
if (s.length === 0 && !f) {
|
|
20
|
+
return n;
|
|
6
21
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
22
|
+
return new Proxy(n, {
|
|
23
|
+
get (t, e, n) {
|
|
24
|
+
const r = Reflect.get(t, e, n);
|
|
25
|
+
if (typeof r !== 'function') {
|
|
26
|
+
return r;
|
|
27
|
+
}
|
|
28
|
+
return function(...n) {
|
|
29
|
+
const o = String(e);
|
|
30
|
+
const a = {
|
|
31
|
+
target: t,
|
|
32
|
+
methodName: o,
|
|
33
|
+
args: n
|
|
34
|
+
};
|
|
35
|
+
const f = c.getAdvicesForJoinPoint(a, s, t, e);
|
|
36
|
+
return TransversalWeaver.executeAdviceChain(f, r, t, n, a);
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
});
|
|
16
40
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
41
|
+
static executeAdviceChain(t, e, n, r, o) {
|
|
42
|
+
const c = t.filter((t)=>t.type === 'before');
|
|
43
|
+
const s = t.filter((t)=>t.type === 'around');
|
|
44
|
+
const a = t.filter((t)=>t.type === 'after');
|
|
45
|
+
try {
|
|
46
|
+
for (const t of c){
|
|
47
|
+
const e = {
|
|
48
|
+
...o,
|
|
49
|
+
config: t.config
|
|
50
|
+
};
|
|
51
|
+
t.method.call(t.transversalInstance, e);
|
|
52
|
+
}
|
|
53
|
+
let t;
|
|
54
|
+
if (s.length > 0) {
|
|
55
|
+
t = this.buildAroundChain(s, e, n, r, o);
|
|
56
|
+
} else {
|
|
57
|
+
t = e.apply(n, r);
|
|
58
|
+
}
|
|
59
|
+
if (t instanceof Promise) {
|
|
60
|
+
return t.then((t)=>{
|
|
61
|
+
for (const e of a){
|
|
62
|
+
const n = {
|
|
63
|
+
...o,
|
|
64
|
+
result: t
|
|
65
|
+
};
|
|
66
|
+
e.method.call(e.transversalInstance, n);
|
|
67
|
+
}
|
|
68
|
+
return t;
|
|
69
|
+
}).catch((t)=>{
|
|
70
|
+
o.error = t;
|
|
71
|
+
throw t;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
for (const e of a){
|
|
75
|
+
const n = {
|
|
76
|
+
...o,
|
|
77
|
+
result: t,
|
|
78
|
+
config: e.config
|
|
79
|
+
};
|
|
80
|
+
e.method.call(e.transversalInstance, n);
|
|
81
|
+
}
|
|
82
|
+
return t;
|
|
83
|
+
} catch (t) {
|
|
84
|
+
o.error = t;
|
|
85
|
+
throw t;
|
|
20
86
|
}
|
|
21
|
-
const e = t.replace(/[.+?^${}()|[\]\\]/g, '\\$&').replace(/\*/g, '.*');
|
|
22
|
-
return new RegExp(`^${e}$`);
|
|
23
87
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
88
|
+
static buildAroundChain(t, e, n, r, o) {
|
|
89
|
+
let c = 0;
|
|
90
|
+
const s = ()=>{
|
|
91
|
+
if (c < t.length) {
|
|
92
|
+
const e = t[c++];
|
|
93
|
+
const n = {
|
|
94
|
+
...o,
|
|
95
|
+
proceed: s,
|
|
96
|
+
config: e.config
|
|
97
|
+
};
|
|
98
|
+
return e.method.call(e.transversalInstance, n);
|
|
99
|
+
} else {
|
|
100
|
+
return e.apply(n, r);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
return s();
|
|
27
104
|
}
|
|
28
|
-
}
|
|
105
|
+
}
|
|
29
106
|
|
|
30
|
-
export {
|
|
107
|
+
export { TransversalWeaver };
|
package/dist/index40.js
CHANGED
|
@@ -2,27 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
class
|
|
6
|
-
static
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const r = this.resolvers.get(e);
|
|
11
|
-
if (!r) {
|
|
12
|
-
throw new Error(`No resolver found for decorator type: ${e}`);
|
|
5
|
+
class PointcutMatcher {
|
|
6
|
+
static parse(t) {
|
|
7
|
+
const e = t.match(/^execution\(([^.]+)\.([^)]+)\)$/);
|
|
8
|
+
if (!e) {
|
|
9
|
+
throw new Error(`Invalid pointcut expression: ${t}`);
|
|
13
10
|
}
|
|
14
|
-
|
|
11
|
+
const [, c, r] = e;
|
|
12
|
+
return new ExecutionPointcutMatcher(c, r);
|
|
15
13
|
}
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
}
|
|
15
|
+
let ExecutionPointcutMatcher = class ExecutionPointcutMatcher {
|
|
16
|
+
matches(t) {
|
|
17
|
+
const e = t.target.constructor.name;
|
|
18
|
+
const c = t.methodName;
|
|
19
|
+
return this.classRegex.test(e) && this.methodRegex.test(c);
|
|
18
20
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
patternToRegex(t) {
|
|
22
|
+
if (t === '*') {
|
|
23
|
+
return /.*/;
|
|
24
|
+
}
|
|
25
|
+
const e = t.replace(/[.+?^${}()|[\]\\]/g, '\\$&').replace(/\*/g, '.*');
|
|
26
|
+
return new RegExp(`^${e}$`);
|
|
21
27
|
}
|
|
22
|
-
|
|
23
|
-
this.
|
|
28
|
+
constructor(t, e){
|
|
29
|
+
this.classRegex = this.patternToRegex(t);
|
|
30
|
+
this.methodRegex = this.patternToRegex(e);
|
|
24
31
|
}
|
|
25
|
-
}
|
|
26
|
-
ResolverStore.resolvers = new Map();
|
|
32
|
+
};
|
|
27
33
|
|
|
28
|
-
exports.
|
|
34
|
+
exports.PointcutMatcher = PointcutMatcher;
|
package/dist/index40.mjs
CHANGED
|
@@ -1,24 +1,30 @@
|
|
|
1
|
-
class
|
|
2
|
-
static
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const r = this.resolvers.get(e);
|
|
7
|
-
if (!r) {
|
|
8
|
-
throw new Error(`No resolver found for decorator type: ${e}`);
|
|
1
|
+
class PointcutMatcher {
|
|
2
|
+
static parse(t) {
|
|
3
|
+
const e = t.match(/^execution\(([^.]+)\.([^)]+)\)$/);
|
|
4
|
+
if (!e) {
|
|
5
|
+
throw new Error(`Invalid pointcut expression: ${t}`);
|
|
9
6
|
}
|
|
10
|
-
|
|
7
|
+
const [, c, r] = e;
|
|
8
|
+
return new ExecutionPointcutMatcher(c, r);
|
|
11
9
|
}
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
}
|
|
11
|
+
let ExecutionPointcutMatcher = class ExecutionPointcutMatcher {
|
|
12
|
+
matches(t) {
|
|
13
|
+
const e = t.target.constructor.name;
|
|
14
|
+
const c = t.methodName;
|
|
15
|
+
return this.classRegex.test(e) && this.methodRegex.test(c);
|
|
14
16
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
patternToRegex(t) {
|
|
18
|
+
if (t === '*') {
|
|
19
|
+
return /.*/;
|
|
20
|
+
}
|
|
21
|
+
const e = t.replace(/[.+?^${}()|[\]\\]/g, '\\$&').replace(/\*/g, '.*');
|
|
22
|
+
return new RegExp(`^${e}$`);
|
|
17
23
|
}
|
|
18
|
-
|
|
19
|
-
this.
|
|
24
|
+
constructor(t, e){
|
|
25
|
+
this.classRegex = this.patternToRegex(t);
|
|
26
|
+
this.methodRegex = this.patternToRegex(e);
|
|
20
27
|
}
|
|
21
|
-
}
|
|
22
|
-
ResolverStore.resolvers = new Map();
|
|
28
|
+
};
|
|
23
29
|
|
|
24
|
-
export {
|
|
30
|
+
export { PointcutMatcher };
|
package/dist/index48.js
CHANGED
package/dist/index48.mjs
CHANGED
package/dist/index49.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
5
|
const dependencies = require('./index50.js');
|
|
6
|
-
const transversalWeaver = require('./
|
|
6
|
+
const transversalWeaver = require('./index39.js');
|
|
7
7
|
const helpers = require('./index37.js');
|
|
8
8
|
|
|
9
9
|
class InjectableBuilder {
|
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.7",
|
|
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",
|