Skip to content

Commit

Permalink
Merge branch 'hotfix/0.3.3' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
emyann committed Oct 26, 2016
2 parents 547a9ea + c6e0abb commit e413e09
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/morphism.js
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
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "morphism",
"version": "0.2.0",
"version": "0.3.2",
"description": "Helps you to transform any object structure to another",
"homepage": "",
"author": {
Expand Down

0 comments on commit e413e09

Please sign in to comment.