fix(job-executor/map): paramName handling

This commit is contained in:
Julien Fontanet 2016-07-29 14:37:42 +02:00
parent d83bf0ebaf
commit 26c5c6152d

View File

@ -61,15 +61,10 @@ const paramsVectorActionsMap = {
fetchObjects ({ pattern }) { fetchObjects ({ pattern }) {
return filter(this.xo.getObjects(), object => match(pattern, object)) return filter(this.xo.getObjects(), object => match(pattern, object))
}, },
map ({ collection, iteratee }) { map ({ collection, iteratee, paramName = 'value' }) {
return map(resolveParamsVector.call(this, collection), value => { return map(resolveParamsVector.call(this, collection), value => {
const {
paramName = 'value',
...iterateeConf
} = iteratee
return resolveParamsVector.call(this, { return resolveParamsVector.call(this, {
...iterateeConf, ...iteratee,
[paramName]: value [paramName]: value
}) })
}) })