@ultraq/object-utils
Advanced tools
+9
-7
@@ -28,11 +28,13 @@ /* | ||
| sources.forEach(source => { | ||
| Object.keys(source).forEach(key => { | ||
| let targetValue = target[key]; | ||
| let sourceValue = source[key]; | ||
| target[key] = targetValue instanceof Object && sourceValue instanceof Object ? | ||
| merge(targetValue, sourceValue) : | ||
| sourceValue; | ||
| }); | ||
| if (source) { | ||
| Object.keys(source).forEach(key => { | ||
| let targetValue = target[key]; | ||
| let sourceValue = source[key]; | ||
| target[key] = targetValue instanceof Object && sourceValue instanceof Object ? | ||
| merge(targetValue, sourceValue) : | ||
| sourceValue; | ||
| }); | ||
| } | ||
| }); | ||
| return target; | ||
| } |
@@ -32,9 +32,11 @@ 'use strict'; | ||
| sources.forEach(source => { | ||
| Object.keys(source).forEach(key => { | ||
| let targetValue = target[key]; | ||
| let sourceValue = source[key]; | ||
| target[key] = targetValue instanceof Object && sourceValue instanceof Object ? | ||
| merge(targetValue, sourceValue) : | ||
| sourceValue; | ||
| }); | ||
| if (source) { | ||
| Object.keys(source).forEach(key => { | ||
| let targetValue = target[key]; | ||
| let sourceValue = source[key]; | ||
| target[key] = targetValue instanceof Object && sourceValue instanceof Object ? | ||
| merge(targetValue, sourceValue) : | ||
| sourceValue; | ||
| }); | ||
| } | ||
| }); | ||
@@ -41,0 +43,0 @@ return target; |
+1
-1
| { | ||
| "name": "@ultraq/object-utils", | ||
| "version": "1.1.0", | ||
| "version": "1.1.1", | ||
| "description": "A collection of utilities for JavaScript objects", | ||
@@ -5,0 +5,0 @@ "author": "Emanuel Rabina <emanuelrabina@gmail.com> (http://www.ultraq.net.nz/)", |
15822
0.34%77
5.48%