putil-merge
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -30,3 +30,3 @@ /* putil-merge | ||
const mergeValue = function(target, source, clone, deep) { | ||
if (typeof source === 'object') { | ||
if (source && typeof source === 'object') { | ||
// Circular reference detection | ||
@@ -36,2 +36,3 @@ var o; | ||
return o; | ||
visited.put(source, target || 1); | ||
@@ -59,3 +60,3 @@ // If array | ||
const mergeObject = function(target, source, clone, deep) { | ||
const mergeObject = function mergeObject(target, source, clone, deep) { | ||
if (source === target) return target; | ||
@@ -76,3 +77,3 @@ Object.getOwnPropertyNames(source).forEach(function(key) { | ||
const cloneArray = function(source, cloneObjects) { | ||
const cloneArray = function cloneArray(source, cloneObjects) { | ||
if (cloneObjects) { | ||
@@ -171,3 +172,4 @@ // Clone object items | ||
get: function(key) { | ||
return values[keys.indexOf(key)]; | ||
const i = keys.indexOf(key); | ||
return i >= 0 ? values[i] : undefined; | ||
} | ||
@@ -174,0 +176,0 @@ }; |
{ | ||
"name": "putil-merge", | ||
"description": "Lightweight solution for merging multiple objects into one. Also it supports deep merge and deep clone", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"author": "Panates Ltd.", | ||
@@ -19,7 +19,7 @@ "contributors": [ | ||
"devDependencies": { | ||
"babel-eslint": "^8.0.0", | ||
"eslint": "^4.7.2", | ||
"babel-eslint": "^8.0.1", | ||
"eslint": "^4.8.0", | ||
"eslint-config-google": "^0.9.1", | ||
"istanbul": "^0.4.5", | ||
"mocha": "^3.5.3" | ||
"mocha": "^4.0.0" | ||
}, | ||
@@ -26,0 +26,0 @@ "engines": { |
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
9696
155