@toa.io/bridges.node 1.0.0-alpha.38 → 1.0.0-alpha.39
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/package.json +5 -5
- package/readme.md +1 -1
- package/src/factory.js +3 -3
- package/test/factory.algorithm.test.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toa.io/bridges.node",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.39",
|
|
4
4
|
"description": "Toa Node Bridge (inproc)",
|
|
5
5
|
"homepage": "https://toa.io",
|
|
6
6
|
"author": {
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@toa.io/core": "1.0.0-alpha.
|
|
30
|
-
"@toa.io/filesystem": "1.0.0-alpha.
|
|
31
|
-
"@toa.io/generic": "1.0.0-alpha.
|
|
29
|
+
"@toa.io/core": "1.0.0-alpha.39",
|
|
30
|
+
"@toa.io/filesystem": "1.0.0-alpha.39",
|
|
31
|
+
"@toa.io/generic": "1.0.0-alpha.39",
|
|
32
32
|
"fast-glob": "3.2.7",
|
|
33
33
|
"matchacho": "0.3.5"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"clone-deep": "4.0.1"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "d9c966c3f8c95c59768e14c61e97d0aeee5ea61f"
|
|
39
39
|
}
|
package/readme.md
CHANGED
package/src/factory.js
CHANGED
|
@@ -8,7 +8,7 @@ const { Context } = require('./context')
|
|
|
8
8
|
const { extract } = require('./define/operations')
|
|
9
9
|
|
|
10
10
|
class Factory {
|
|
11
|
-
algorithm (root, name, context) {
|
|
11
|
+
async algorithm (root, name, context) {
|
|
12
12
|
const module = load.operation(root, name)
|
|
13
13
|
const ctx = new Context(context)
|
|
14
14
|
|
|
@@ -36,11 +36,11 @@ class Factory {
|
|
|
36
36
|
* @param {toa.node.Context} context
|
|
37
37
|
* @returns {Runner}
|
|
38
38
|
*/
|
|
39
|
-
function runner (module, context) {
|
|
39
|
+
async function runner (module, context) {
|
|
40
40
|
const descriptor = extract(module)
|
|
41
41
|
const func = module[descriptor.name]
|
|
42
42
|
const factory = require('./algorithms/' + descriptor.syntax)
|
|
43
|
-
const instance = factory.create(func)
|
|
43
|
+
const instance = await factory.create(func)
|
|
44
44
|
|
|
45
45
|
return new Runner(instance, context)
|
|
46
46
|
}
|
|
@@ -26,7 +26,7 @@ it('should be', () => {
|
|
|
26
26
|
|
|
27
27
|
for (const sample of ['fn', 'cls', 'fct']) {
|
|
28
28
|
it(`should create '${sample}' operation`, async () => {
|
|
29
|
-
const algorithm = factory.algorithm(root, sample, context)
|
|
29
|
+
const algorithm = await factory.algorithm(root, sample, context)
|
|
30
30
|
|
|
31
31
|
expect(algorithm).toBeDefined()
|
|
32
32
|
|