jQuery.extend(true, ...)

jQuery.extend(true, ...)

Wat a hell is going here?
// Recurse if we're merging object values
if ( deep && copy && typeof copy === "object" && !copy.nodeType ) {
var clone;
if ( src ) {
clone = src;
} else if ( jQuery.isArray(copy) ) {
clone = [];
} else if ( jQuery.isObject(copy) ) {
clone = {};
} else {
clone = copy;
}
// Never move original objects, clone them
target[ name ] = jQuery.extend( deep, clone, copy );
You are going to extend with any object including a Date, a String, a
Number... (ah yes, excluding nodes).
You are going to extend (with) arrays? [1,2] and [4] to obtain [4,2].
Really?
If an object is not an array nor an object literal then extend object
with itself???
The only things to extend recursively are objects literals to me:
if ( deep && copy && jQuery.isObject(copy) && (!src || jQuery.isObject
(src)) ) {
target[ name ] = jQuery.extend( deep, src || {}, copy );
}
Am I loosing my mind? :)
--