src/mongo/shell/replsettest.js
/**
     * Recursively merge the target and source object.
     */
Recursively merge the target and source object.
Recursively merge the target and source object .
function _deepObjectMerge(target, source) {
        if (!(target instanceof Object)) {
            return (source === undefined || source === null) ? target : source;
        }
        if (!(source instanceof Object)) {
            return target;
        }
        let res = Object.assign({}, target);
        Object.keys(source).forEach(k => {
            res[k] = _deepObjectMerge(target[k], source[k]);
        });
        return res;
    }
function _deepObjectMerge ( target , source ) { if ( ! ( target instanceof Object ) ) { return ( source === undefined || source === null ) ? target : source ; } if ( ! ( source instanceof Object ) ) { return target ; } let res = Object . assign ( { } , target ) ; Object . keys ( source ) . forEach ( k => { res [ k ] = _deepObjectMerge ( target [ k ] , source [ k ] ) ; } ) ; return res ; }
Recursively merge the target and source object.
Recursively merge the target and source object .