Skip to content

Commit

Permalink
fix: populatePaths fixes #410
Browse files Browse the repository at this point in the history
  • Loading branch information
fopsdev committed Nov 10, 2016
1 parent 356413d commit b886cc2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/cerebral/src/operators/helpers/populatePath.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ export default function populatePath (context, strings, values) {
return currentPath + string + context.state.compute(valueTemplate)
}

return currentPath + string + (valueTemplate ? valueTemplate(context).toValue() : '')
if (valueTemplate && typeof valueTemplate === 'function') {
return currentPath + string + valueTemplate(context).toValue()
}

return currentPath + string + (valueTemplate ? valueTemplate : '')
}, '')
}

0 comments on commit b886cc2

Please sign in to comment.