docs/vendor/mixitup/mixitup.js
function(destination, source, deep, handleErrors) {
            var sourceKeys  = [],
                key         = '',
                i           = -1;

            deep = deep || false;
            handleErrors = handleErrors || false;

            try {
                if (Array.isArray(source)) {
                    for (i = 0; i < source.length; i++) {
                        sourceKeys.push(i);
                    }
                } else if (source) {
                    sourceKeys = Object.keys(source);
                }

                for (i = 0; i < sourceKeys.length; i++) {
                    key = sourceKeys[i];

                    if (!deep || typeof source[key] !== 'object' || this.isElement(source[key])) {
                        // All non-object properties, or all properties if shallow extend

                        destination[key] = source[key];
                    } else if (Array.isArray(source[key])) {
                        // Arrays

                        if (!destination[key]) {
                            destination[key] = [];
                        }

                        this.extend(destination[key], source[key], deep, handleErrors);
                    } else {
                        // Objects

                        if (!destination[key]) {
                            destination[key] = {};
                        }

                        this.extend(destination[key], source[key], deep, handleErrors);
                    }
                }
            } catch(err) {
                if (handleErrors) {
                    this.handleExtendError(err, destination);
                } else {
                    throw err;
                }
            }

            return destination;
        }
function(destination, source, deep, handleErrors) {
            var sourceKeys  = [],
                key         = '',
                i           = -1;

            deep = deep || false;
            handleErrors = handleErrors || false;

            try {
                if (Array.isArray(source)) {
                    for (i = 0; i < source.length; i++) {
                        sourceKeys.push(i);
                    }
                } else if (source) {
                    sourceKeys = Object.keys(source);
                }

                for (i = 0; i < sourceKeys.length; i++) {
                    key = sourceKeys[i];

                    if (!deep || typeof source[key] !== 'object' || this.isElement(source[key])) {
                        // All non-object properties, or all properties if shallow extend

                        destination[key] = source[key];
                    } else if (Array.isArray(source[key])) {
                        // Arrays

                        if (!destination[key]) {
                            destination[key] = [];
                        }

                        this.extend(destination[key], source[key], deep, handleErrors);
                    } else {
                        // Objects

                        if (!destination[key]) {
                            destination[key] = {};
                        }

                        this.extend(destination[key], source[key], deep, handleErrors);
                    }
                }
            } catch(err) {
                if (handleErrors) {
                    this.handleExtendError(err, destination);
                } else {
                    throw err;
                }
            }

            return destination;
        }
function ( destination , source , deep , handleErrors ) { var sourceKeys = [ ] , key = '' , i = - 1 ; deep = deep || false ; handleErrors = handleErrors || false ; try { if ( Array . isArray ( source ) ) { for ( i = 0 ; i < source . length ; i ++ ) { sourceKeys . push ( i ) ; } } else if ( source ) { sourceKeys = Object . keys ( source ) ; } for ( i = 0 ; i < sourceKeys . length ; i ++ ) { key = sourceKeys [ i ] ; if ( ! deep || typeof source [ key ] !== 'object' || this . isElement ( source [ key ] ) ) { // All non-object properties, or all properties if shallow extend destination [ key ] = source [ key ] ; } else if ( Array . isArray ( source [ key ] ) ) { // Arrays if ( ! destination [ key ] ) { destination [ key ] = [ ] ; } this . extend ( destination [ key ] , source [ key ] , deep , handleErrors ) ; } else { // Objects if ( ! destination [ key ] ) { destination [ key ] = { } ; } this . extend ( destination [ key ] , source [ key ] , deep , handleErrors ) ; } } } catch ( err ) { if ( handleErrors ) { this . handleExtendError ( err , destination ) ; } else { throw err ; } } return destination ; }
Merges the properties of the source object onto the
target object. Alters the target object.

@private
@param   {object}    destination
@param   {object}    source
@param   {boolean}   [deep=false]
@param   {boolean}   [handleErrors=false]
@return  {void}
Merges the properties of the source object onto the target object . Alters the target object .