Comparing version 0.2.16 to 0.2.17
@@ -7,5 +7,5 @@ 'use strict'; | ||
var _assign = require('babel-runtime/core-js/object/assign'); | ||
var _stringify = require('babel-runtime/core-js/json/stringify'); | ||
var _assign2 = _interopRequireDefault(_assign); | ||
var _stringify2 = _interopRequireDefault(_stringify); | ||
@@ -23,3 +23,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var promises = items.map(function (item) { | ||
var payload = (0, _assign2.default)({}, ctx.input); | ||
var payload = JSON.parse((0, _stringify2.default)(ctx.input)); | ||
set(payload, inputPath, item); | ||
@@ -26,0 +26,0 @@ return execute(providers, payload, task); |
{ | ||
"name": "arnie", | ||
"version": "0.2.16", | ||
"version": "0.2.17", | ||
"description": "Action hero for backends", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -11,3 +11,3 @@ const A = require('../') | ||
(item) => { | ||
const payload = Object.assign({}, ctx.input) | ||
const payload = JSON.parse(JSON.stringify(ctx.input)) | ||
set(payload, inputPath, item) | ||
@@ -14,0 +14,0 @@ return execute(providers, payload, task) |
@@ -13,6 +13,11 @@ const test = require('tape') | ||
({input}) => { | ||
num += 1 | ||
t.pass(`should execute a new function-tree for each item ${num}/2`) | ||
t.assert(!input.localOutput, `should isolate payload of each function-tree ${num}/2`) | ||
return {localOutput: true} | ||
return new Promise((resolve, reject) => { | ||
setTimeout(() => { | ||
num += 1 | ||
t.pass(`should execute a new function-tree for iteration ${num}/2`) | ||
t.assert(input.deep.param.value === 1, `should use isolated payload for iteration ${num}/2`) | ||
input.deep.param.value += 1 | ||
resolve(input) | ||
}, Math.random() * 300 + 50) | ||
}) | ||
} | ||
@@ -22,3 +27,3 @@ ]), | ||
t.assert(num === 2, 'finish iteration before next action') | ||
t.assert(!input.localOutput, 'should use isolated payload') | ||
t.assert(input.deep.param.value === 1, 'should use isolated payload') | ||
} | ||
@@ -28,5 +33,6 @@ ] | ||
const payload = { | ||
list: [1, 2] | ||
list: [1, 2], | ||
deep: {param: {value: 1}} | ||
} | ||
arnie(task, payload).catch(console.error) | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
159101
3443