lib/utils.js
function mergeHelper(base, mixin, name, mergeArrays) {
    if (Array.isArray(mixin[name])) {
        if (!mergeArrays && base[name] && Array.isArray(base[name])) {
            base[name] = base[name].concat(mixin[name]);
        } else {
            base[name] = mixin[name];
        }
    } else if (typeof mixin[name] === 'object' && mixin[name] !== null) {
        let newBase = base[name] || {};
        if (Array.isArray(newBase)) {
            newBase = {};
        }
        mergeInner(newBase, mixin[name], mergeArrays);
        base[name] = newBase;
    } else {
        base[name] = mixin[name];
    }
}
function mergeHelper(base, mixin, name, mergeArrays) {
    if (Array.isArray(mixin[name])) {
        if (!mergeArrays && base[name] && Array.isArray(base[name])) {
            base[name] = base[name].concat(mixin[name]);
        } else {
            base[name] = mixin[name];
        }
    } else if (typeof mixin[name] === 'object' && mixin[name] !== null) {
        let newBase = base[name] || {};
        if (Array.isArray(newBase)) {
            newBase = {};
        }
        mergeInner(newBase, mixin[name], mergeArrays);
        base[name] = newBase;
    } else {
        base[name] = mixin[name];
    }
}
function mergeHelper ( base , mixin , name , mergeArrays ) { if ( Array . isArray ( mixin [ name ] ) ) { if ( ! mergeArrays && base [ name ] && Array . isArray ( base [ name ] ) ) { base [ name ] = base [ name ] . concat ( mixin [ name ] ) ; } else { base [ name ] = mixin [ name ] ; } } else if ( typeof mixin [ name ] === 'object' && mixin [ name ] !== null ) { let newBase = base [ name ] || { } ; if ( Array . isArray ( newBase ) ) { newBase = { } ; } mergeInner ( newBase , mixin [ name ] , mergeArrays ) ; base [ name ] = newBase ; } else { base [ name ] = mixin [ name ] ; } }
Merge helper - FOR INTERNAL USE ONLY

@param {object} base Base object to merge `mixin` into
@param {object} mixin Mixin object to merge into `base`
@param {string} name Name of property to merge
@param {boolean} [mergeArrays] Merge arrays instead of concatenating them
Merge helper - FOR INTERNAL USE ONLY