Comparing version 1.0.7 to 1.0.8
{ | ||
"name": "blend.js", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"authors": [ | ||
@@ -21,3 +21,6 @@ "Kieran Boyle <norcal.kieran@gmail.com>" | ||
"merge", | ||
"shallow" | ||
"shallow", | ||
"node", | ||
"objects", | ||
"arrays" | ||
], | ||
@@ -24,0 +27,0 @@ "homepage": "https://github.com/dysfunc/blend.js", |
@@ -63,5 +63,10 @@ 'use strict'; | ||
deep = false, | ||
dedup = false; | ||
dedup = false, | ||
type = typeof(target); | ||
if(typeof(target) === 'boolean'){ | ||
if(type === 'boolean' && target === false || type !== 'boolean' && type !== 'object' || target === null){ | ||
throw new Error('You passed an invalid argument as the target. This should either be an object or true for deep copy.'); | ||
} | ||
if(type === 'boolean'){ | ||
deep = target; | ||
@@ -68,0 +73,0 @@ target = arguments[1] || {}; |
@@ -1,1 +0,1 @@ | ||
"use strict";var blend=function(){var n=function(n){return!("object"!=typeof n||n&&n.nodeType||null!==n&&n===n.window||n&&n.constructor&&!Object.prototype.hasOwnProperty.call(n.constructor.prototype,"isPrototypeOf"))},r=function(n){for(var r=n.concat(),t=0;t<r.length;++t)for(var o=t+1;o<r.length;++o)r[t]===r[o]&&r.splice(o--,1);return r},t=function(o){var e=1,c=!1,a=!1;return"boolean"==typeof o&&(c=o,o=arguments[1]||{},e++,"boolean"==typeof o&&(a=o,o=arguments[2]||{},e++)),[].slice.call(arguments,e).forEach(function(e){var f,i,u,s;if(e!==o)if(c&&e instanceof Array)o=a?r(o.concat(e)):o.concat(e);else for(var l in e)f=o[l],i=e[l],o!==i&&f!==i&&((u=i instanceof Array)||c&&i&&n(i)?(s=u?f&&f instanceof Array?f:[]:f&&n(f)?f:{},u=!1,a?o[l]=t(c,a,s,i):o[l]=t(c,s,i)):void 0!==i&&(o[l]=i))}),o};return t}();if(typeof window !== 'undefined'){window.blend=blend;} | ||
var blend=function(){var o=function(o){return!("object"!=typeof o||o&&o.nodeType||null!==o&&o===o.window||o&&o.constructor&&!Object.prototype.hasOwnProperty.call(o.constructor.prototype,"isPrototypeOf"))},r=function(o){for(var r=o.concat(),n=0;n<r.length;++n)for(var e=n+1;e<r.length;++e)r[n]===r[e]&&r.splice(e--,1);return r},n=function(e){var t=1,a=!1,c=!1,i=typeof e;if("boolean"===i&&e===!1||"boolean"!==i&&"object"!==i||null===e)throw new Error("You passed an invalid argument as the target. This should either be an object or true for deep copy.");return"boolean"===i&&(a=e,e=arguments[1]||{},t++,"boolean"==typeof e&&(c=e,e=arguments[2]||{},t++)),[].slice.call(arguments,t).forEach(function(t){var i,f,l,u;if(t!==e)if(a&&t instanceof Array)e=c?r(e.concat(t)):e.concat(t);else for(var s in t)i=e[s],f=t[s],e!==f&&i!==f&&((l=f instanceof Array)||a&&f&&o(f)?(u=l?i&&i instanceof Array?i:[]:i&&o(i)?i:{},l=!1,c?e[s]=n(a,c,u,f):e[s]=n(a,u,f)):void 0!==f&&(e[s]=f))}),e};return n}(); |
{ | ||
"name": "blend.js", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "Micro-lib for performing shallow/deep copying of objects with support for array merging + dedup", | ||
@@ -24,3 +24,2 @@ "author": "Kieran Boyle <norcal.kieran@gmail.com>", | ||
"merge", | ||
"copy", | ||
"deep", | ||
@@ -30,4 +29,6 @@ "copy", | ||
"shallow", | ||
"shallow", | ||
"copy" | ||
"node", | ||
"jquery", | ||
"objects", | ||
"arrays" | ||
], | ||
@@ -34,0 +35,0 @@ "license": "ISC", |
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
9576
169