Skip to content

Commit

Permalink
Release 0.0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
edy committed Jun 28, 2017
1 parent 454cb90 commit a32b05e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
17 changes: 14 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ function filterObject(_ref, state) {
} : _ref$filterFunction;

var value = (0, _lodash2.default)(state, path);

if (value instanceof Array) {
return value.filter(filterFunction);
}

return (0, _lodash8.default)(value, filterFunction);
}

Expand Down Expand Up @@ -107,9 +112,15 @@ function persistFilter(state) {
var value = filterObject(path, state);

if (!(0, _lodash10.default)(value)) {
(0, _lodash12.default)(value, function (value, key) {
(0, _lodash6.default)(subset, path.path + '.' + key);
});
if (value instanceof Array) {
(0, _lodash4.default)(subset, path.path, (0, _lodash2.default)(subset, path.path).filter(function (x) {
return false;
}));
} else {
(0, _lodash12.default)(value, function (value, key) {
(0, _lodash6.default)(subset, path.path + '[' + key + ']');
});
}
}
} else {
var _value2 = (0, _lodash2.default)(state, path);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "redux-persist-transform-filter",
"version": "0.0.13",
"version": "0.0.14",
"description": "Filter transformator for redux-persist",
"main": "dist/index.js",
"scripts": {
Expand Down

0 comments on commit a32b05e

Please sign in to comment.