Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

redux-persist-transform-filter

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-persist-transform-filter - npm Package Compare versions

Comparing version 0.0.13 to 0.0.14

17

dist/index.js

@@ -73,2 +73,7 @@ 'use strict';

var value = (0, _lodash2.default)(state, path);
if (value instanceof Array) {
return value.filter(filterFunction);
}
return (0, _lodash8.default)(value, filterFunction);

@@ -111,5 +116,11 @@ }

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 + ']');
});
}
}

@@ -116,0 +127,0 @@ } else {

17

index.js

@@ -38,4 +38,9 @@ import { createTransform } from 'redux-persist';

function filterObject({ path, filterFunction = () => true }, state) {
const value = get(state, path);
return pickBy(value, filterFunction);
const value = get(state, path);
if (value instanceof Array) {
return value.filter(filterFunction)
}
return pickBy(value, filterFunction);
}

@@ -74,3 +79,7 @@

if (!isEmpty(value)) {
forIn(value, (value, key) => { unset(subset, `${path.path}.${key}`) });
if (value instanceof Array) {
set(subset, path.path, get(subset, path.path).filter((x) => false));
} else {
forIn(value, (value, key) => { unset(subset, `${path.path}[${key}]`) });
}
}

@@ -83,3 +92,3 @@ } else {

}
}
}
});

@@ -86,0 +95,0 @@ } else {

{
"name": "redux-persist-transform-filter",
"version": "0.0.13",
"version": "0.0.14",
"description": "Filter transformator for redux-persist",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc