Skip to content

Commit a32b05e

Browse files
committed
Release 0.0.14
1 parent 454cb90 commit a32b05e

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

dist/index.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ function filterObject(_ref, state) {
7070
} : _ref$filterFunction;
7171

7272
var value = (0, _lodash2.default)(state, path);
73+
74+
if (value instanceof Array) {
75+
return value.filter(filterFunction);
76+
}
77+
7378
return (0, _lodash8.default)(value, filterFunction);
7479
}
7580

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

109114
if (!(0, _lodash10.default)(value)) {
110-
(0, _lodash12.default)(value, function (value, key) {
111-
(0, _lodash6.default)(subset, path.path + '.' + key);
112-
});
115+
if (value instanceof Array) {
116+
(0, _lodash4.default)(subset, path.path, (0, _lodash2.default)(subset, path.path).filter(function (x) {
117+
return false;
118+
}));
119+
} else {
120+
(0, _lodash12.default)(value, function (value, key) {
121+
(0, _lodash6.default)(subset, path.path + '[' + key + ']');
122+
});
123+
}
113124
}
114125
} else {
115126
var _value2 = (0, _lodash2.default)(state, path);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "redux-persist-transform-filter",
3-
"version": "0.0.13",
3+
"version": "0.0.14",
44
"description": "Filter transformator for redux-persist",
55
"main": "dist/index.js",
66
"scripts": {

0 commit comments

Comments
 (0)