Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

arch-orchestrator

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arch-orchestrator - npm Package Compare versions

Comparing version 1.3.2 to 1.3.3

12

lib/redirect.js

@@ -52,3 +52,7 @@ 'use strict';

metadata.argsTo.forEach(function (fn) {
fn.meta.args = args.slice();
if (!fn.meta.args) {
fn.meta.args = args.slice();
} else {
fn.meta.args = fn.meta.args.concat(args.slice());
}
});

@@ -65,3 +69,7 @@ }

metadata.resultTo.forEach(function (fn) {
fn.meta.args = result;
if (!fn.meta.args) {
fn.meta.args = result;
} else {
fn.meta.args = fn.meta.args.concat(result);
}
});

@@ -68,0 +76,0 @@ }

2

package.json
{
"name": "arch-orchestrator",
"version": "1.3.2",
"version": "1.3.3",
"description": "Orchestrator for large node.js applications",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -204,3 +204,24 @@ arch-orchestrator

You can call ``resultTo`` and ``argsTo`` multiple times, or even combine them.
##### Example:
```Javascript
var fn = orchestrator()
.setNext(fn1).argsTo(fn4)
.setNext(fn2).resultTo(fn4)
.setNext(fn3)
.setNext(fn4)
.end();
```
In this case arguments on ``fn4`` will be available in order as functions ``argsTo`` and ``resultTo`` are called,
so ``fn4`` can look like:
```Javascript
function fn4(next, argFromArgsTo, argFromResultTo) {
// do something awesome
}
```
# License
**MIT**

@@ -24,2 +24,6 @@ 'use strict';

function fn4(next, arg1, arg2) {
return next(arg1 + arg2 + 10);
}
function first(next) {

@@ -217,2 +221,14 @@ return next('first');

it('should be able to prepend arguments which are arguments of some other generator chain function calling argsTo multiple times', function () {
fn = orchestrator()
.setNext(fn1).argsTo(fn4)
.setNext(fn2).argsTo(fn4)
.setNext(fn3)
.setNext(fn4)
.end();
var res = fn(5);
res.should.be.exactly(120);
});
it('should be able to prepend arguments which are arguments of some other generator chain function', function * () {

@@ -262,2 +278,14 @@ fn = orchestrator()

it('should be able to prepend arguments which are result of some function multiple times', function () {
fn = orchestrator()
.setNext(fn1).resultTo(fn4)
.setNext(fn2)
.setNext(fn3).resultTo(fn4)
.setNext(fn4)
.end();
var res = fn(10);
res.should.be.exactly(730);
});
it('should be able to prepend arguments which are result of some generator function', function * () {

@@ -278,2 +306,14 @@ fn = orchestrator()

it('should be able to combine argsTo and resultTo calls', function () {
fn = orchestrator()
.setNext(fn1).argsTo(fn4)
.setNext(fn2).resultTo(fn4)
.setNext(fn3)
.setNext(fn4)
.end();
var res = fn(5);
res.should.be.exactly(320);
});
it('should be able to use current result as final for normal chain functions', function () {

@@ -280,0 +320,0 @@ fn = orchestrator()

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc