Skip to content

Commit

Permalink
Merge branch 'hotfix/0.3.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
emyann committed Oct 26, 2016
2 parents 511cacf + c6e0abb commit 346934b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/morphism.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function Morphism(schema, items, type) {
return _.get(obj, predicate);
}
else if (_.isFunction(predicate)) { // a predicate function without a path
return predicate(obj);
return predicate(obj, items);
}
else if (_.isArray(predicate)) { // a predicate array of string path => agregator
return _.reduce(predicate, (delta, path) => {
Expand All @@ -19,7 +19,7 @@ export default function Morphism(schema, items, type) {
}
else { // a predicate object with a path and a function
let delta = _.get(obj, predicate.path);
return predicate.fn(delta);
return predicate.fn(delta, items);
}
});
return transformedObject;
Expand Down

0 comments on commit 346934b

Please sign in to comment.