Comparing version 0.2.2 to 0.2.3
{ | ||
"name": "reduxerit", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "redux utils to generate reducer and actions in a shorter way", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -23,3 +23,8 @@ const removeIn = (o, target, modifier) => { | ||
let cur; | ||
if(typeof target === 'string' ) | ||
const targetType = typeof target; | ||
if(targetType !== 'string' && !Array.isArray(target) ) | ||
return modifier(o) | ||
if( targetType === 'string' ) | ||
cur = target | ||
@@ -30,3 +35,3 @@ else { | ||
if (target.length === 0 || typeof target === 'string') { | ||
if (target.length === 0 || targetType === 'string') { | ||
return {...o, [cur]: modifier(o[cur])} | ||
@@ -33,0 +38,0 @@ } |
@@ -46,2 +46,7 @@ import chai from 'chai'; | ||
it('setIn - with target null', () => | ||
setIn(obj, null, {changeAll:"true story bro!"}) | ||
.should.be.deep.equal({changeAll:"true story bro!"}) | ||
) | ||
const obj1 = { | ||
@@ -48,0 +53,0 @@ a:"a", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9225
298