assemblerjs 1.1.7 → 1.1.9
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/index11.js +2 -2
- package/dist/index11.mjs +2 -2
- package/dist/index13.js +2 -2
- package/dist/index13.mjs +2 -2
- package/dist/index16.js +1 -1
- package/dist/index16.mjs +1 -1
- package/dist/index17.js +1 -1
- package/dist/index17.mjs +1 -1
- package/dist/index18.js +1 -1
- package/dist/index18.mjs +1 -1
- package/dist/index19.js +1 -1
- package/dist/index19.mjs +1 -1
- package/dist/index2.js +2 -2
- package/dist/index2.mjs +2 -2
- 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 +2 -2
- package/dist/index22.mjs +2 -2
- package/dist/index23.js +2 -2
- package/dist/index23.mjs +2 -2
- package/dist/index24.js +2 -2
- package/dist/index24.mjs +2 -2
- package/dist/index25.js +1 -1
- package/dist/index25.mjs +1 -1
- package/dist/index26.js +1 -1
- package/dist/index26.mjs +1 -1
- package/dist/index29.js +38 -15
- package/dist/index29.mjs +37 -12
- package/dist/index3.js +1 -1
- package/dist/index3.mjs +1 -1
- package/dist/index30.js +130 -100
- package/dist/index30.mjs +130 -98
- package/dist/index31.js +36 -103
- package/dist/index31.mjs +36 -103
- package/dist/index32.js +70 -41
- package/dist/index32.mjs +70 -41
- package/dist/index33.js +37 -75
- package/dist/index33.mjs +37 -75
- package/dist/index34.js +29 -39
- package/dist/index34.mjs +29 -39
- package/dist/index35.js +151 -26
- package/dist/index35.mjs +151 -26
- package/dist/index36.js +16 -133
- package/dist/index36.mjs +13 -133
- package/dist/index37.js +100 -33
- package/dist/index37.mjs +98 -32
- package/dist/index38.js +101 -18
- package/dist/index38.mjs +101 -18
- package/dist/index39.js +24 -101
- package/dist/index39.mjs +24 -101
- package/dist/index4.js +6 -6
- package/dist/index4.mjs +6 -6
- package/dist/index40.js +18 -24
- package/dist/index40.mjs +18 -24
- package/dist/index41.js +29 -49
- package/dist/index41.mjs +28 -49
- package/dist/index43.js +49 -29
- package/dist/index43.mjs +49 -28
- package/dist/index44.js +4 -4
- package/dist/index44.mjs +4 -4
- package/dist/index48.js +1 -1
- package/dist/index48.mjs +1 -1
- package/dist/index49.js +2 -2
- package/dist/index49.mjs +2 -2
- package/dist/index50.js +1 -1
- package/dist/index50.mjs +1 -1
- package/package.json +1 -1
package/dist/index41.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/index43.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/index43.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/index44.js
CHANGED
|
@@ -4,14 +4,14 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4
4
|
|
|
5
5
|
const core = require('@assemblerjs/core');
|
|
6
6
|
const constants = require('./index28.js');
|
|
7
|
-
const reflection = require('./
|
|
7
|
+
const reflection = require('./index36.js');
|
|
8
8
|
const injectableBuilder = require('./index49.js');
|
|
9
9
|
const dependencies = require('./index50.js');
|
|
10
|
-
const helpers = require('./
|
|
11
|
-
const hookManager = require('./
|
|
10
|
+
const helpers = require('./index29.js');
|
|
11
|
+
const hookManager = require('./index32.js');
|
|
12
12
|
const helpers$1 = require('./index3.js');
|
|
13
13
|
const use = require('./index42.js');
|
|
14
|
-
const schema = require('./
|
|
14
|
+
const schema = require('./index37.js');
|
|
15
15
|
const decorators = require('./index11.js');
|
|
16
16
|
const transversalManager = require('./index13.js');
|
|
17
17
|
|
package/dist/index44.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { isClass, clearInstance } from '@assemblerjs/core';
|
|
2
2
|
import { ReflectValue } from './index28.mjs';
|
|
3
|
-
import { defineCustomMetadata } from './
|
|
3
|
+
import { defineCustomMetadata } from './index36.mjs';
|
|
4
4
|
import { InjectableBuilder } from './index49.mjs';
|
|
5
5
|
import { resolveDependencies } from './index50.mjs';
|
|
6
|
-
import { unregisterEvents } from './
|
|
7
|
-
import { HookManager } from './
|
|
6
|
+
import { unregisterEvents } from './index29.mjs';
|
|
7
|
+
import { HookManager } from './index32.mjs';
|
|
8
8
|
import { isAssemblage } from './index3.mjs';
|
|
9
9
|
import { isFactory } from './index42.mjs';
|
|
10
|
-
import { getDefinition } from './
|
|
10
|
+
import { getDefinition } from './index37.mjs';
|
|
11
11
|
import { isTransversal } from './index11.mjs';
|
|
12
12
|
import { TransversalManager } from './index13.mjs';
|
|
13
13
|
|
package/dist/index48.js
CHANGED
package/dist/index48.mjs
CHANGED
package/dist/index49.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
5
|
const dependencies = require('./index50.js');
|
|
6
|
-
const transversalWeaver = require('./
|
|
7
|
-
const helpers = require('./
|
|
6
|
+
const transversalWeaver = require('./index38.js');
|
|
7
|
+
const helpers = require('./index29.js');
|
|
8
8
|
|
|
9
9
|
class InjectableBuilder {
|
|
10
10
|
build(i) {
|
package/dist/index49.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveInjectableParameters } from './index50.mjs';
|
|
2
|
-
import { TransversalWeaver } from './
|
|
3
|
-
import { registerEvents } from './
|
|
2
|
+
import { TransversalWeaver } from './index38.mjs';
|
|
3
|
+
import { registerEvents } from './index29.mjs';
|
|
4
4
|
|
|
5
5
|
class InjectableBuilder {
|
|
6
6
|
build(i) {
|
package/dist/index50.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const reflection = require('./
|
|
5
|
+
const reflection = require('./index36.js');
|
|
6
6
|
const helpers = require('./index25.js');
|
|
7
7
|
const parameterResolver_factory = require('./index48.js');
|
|
8
8
|
const decorators = require('./index11.js');
|
package/dist/index50.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.9",
|
|
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",
|