Comparing version 1.0.6 to 1.0.7
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.covermerge=e()}(this,function(){"use strict";var c=function(t){return!(!(n=t)||"object"!=typeof n||(e=t,"[object RegExp]"===(o=Object.prototype.toString.call(e))||"[object Date]"===o||e.$$typeof===r));var e,o,n};var r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;var t=function(t){return"[object Array]"===Object.prototype.toString.call(t)},i=function(t){return void 0===t&&(t={}),JSON.parse(JSON.stringify(t))},u=function(o,n,r){var f;if(void 0===r&&(r=!1),!c(o)||!c(n))return i(o);if(t(o)&&!t(n)||!t(o)&&t(n))return i(o);t(o)?(f=[],(r?o:n).forEach(function(t,e){c(o[e])?f[e]=u(o[e],n[e],r):c(n[e])?void 0===o[e]&&void 0===o[0]?f[e]=i(n[e]):f[e]=u(o[0],n[e],r):(typeof o[e]==typeof n[e]&&n[e],f[e]=n[e])})):(f={},Object.keys(o).forEach(function(t){c(o[t])?f[t]=u(o[t],n[t],!!t.match(/^_.+_$/)):typeof o[t]==typeof n[t]&&null!==n[t]?f[t]=n[t]:f[t]=o[t]}),Object.keys(n).forEach(function(t){void 0===f[t]&&(f[t]=i(n[t]))}));return f};return u}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.covermerge=e()}(this,function(){"use strict";var c=function(t){return!(!(n=t)||"object"!=typeof n||(e=t,"[object RegExp]"===(o=Object.prototype.toString.call(e))||"[object Date]"===o||e.$$typeof===r));var e,o,n};var r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;var t=function(t){return"[object Array]"===Object.prototype.toString.call(t)},i=function(t){return void 0===t?t:JSON.parse(JSON.stringify(t))},u=function(o,n,r){var f;if(void 0===r&&(r=!1),!c(o)||!c(n))return i(o);if(t(o)&&!t(n)||!t(o)&&t(n))return i(o);t(o)?(f=[],(r?o:n).forEach(function(t,e){c(o[e])?f[e]=u(o[e],n[e],r):c(n[e])?void 0===o[e]&&void 0===o[0]?f[e]=i(n[e]):f[e]=u(o[0],n[e],r):(o[e],n[e],f[e]=n[e])})):(f={},Object.keys(o).forEach(function(t){c(o[t])?f[t]=u(o[t],n[t],!!t.match(/^_.+_$/)):typeof o[t]==typeof n[t]?f[t]=n[t]:f[t]=o[t]}),Object.keys(n).forEach(function(t){void 0===f[t]&&(f[t]=i(n[t]))}));return f};return u}); |
{ | ||
"name": "covermerge", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "merge user old data to default scheme", | ||
@@ -5,0 +5,0 @@ "main": "covermerge.umd.js", |
@@ -5,3 +5,8 @@ import isMergeableObject from 'is-mergeable-object' | ||
const deepCopy = (obj = {}) => JSON.parse(JSON.stringify(obj)) | ||
const deepCopy = obj => { | ||
if (typeof obj === 'undefined') { | ||
return obj | ||
} | ||
return JSON.parse(JSON.stringify(obj)) | ||
} | ||
@@ -39,3 +44,3 @@ const covermerge = (target, source, syncLength = false) => { | ||
} | ||
} else if (typeof target[index] === typeof source[index] && source[index] !== null) { | ||
} else if (typeof target[index] === typeof source[index]) { | ||
result[index] = source[index] | ||
@@ -51,3 +56,3 @@ } else { | ||
result[key] = covermerge(target[key], source[key], !!key.match(/^_.+_$/)) | ||
} else if (typeof target[key] === typeof source[key] && source[key] !== null) { | ||
} else if (typeof target[key] === typeof source[key]) { | ||
result[key] = source[key] | ||
@@ -54,0 +59,0 @@ } else { |
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
68
4716