lib/index.js
function updateDeeply(target, override) {

    /**
     * Is hash object
     * @param {Object} value - Test value
     * @returns {boolean} Result
     */
    function isHashObject(value) {
        return typeof value === "object" && value instanceof Object && !(value instanceof Array) && !(value instanceof RegExp);
    }

    for (const key in override) {
        if (override.hasOwnProperty(key)) {
            const val = override[key];

            if (isHashObject(val)) {
                if (isHashObject(target[key])) {
                    updateDeeply(target[key], val);
                } else {
                    target[key] = updateDeeply({}, val);
                }
            } else {
                target[key] = val;
            }
        }
    }
    return target;
}
function updateDeeply(target, override) {

    /**
     * Is hash object
     * @param {Object} value - Test value
     * @returns {boolean} Result
     */
    function isHashObject(value) {
        return typeof value === "object" && value instanceof Object && !(value instanceof Array) && !(value instanceof RegExp);
    }

    for (const key in override) {
        if (override.hasOwnProperty(key)) {
            const val = override[key];

            if (isHashObject(val)) {
                if (isHashObject(target[key])) {
                    updateDeeply(target[key], val);
                } else {
                    target[key] = updateDeeply({}, val);
                }
            } else {
                target[key] = val;
            }
        }
    }
    return target;
}
function updateDeeply ( target , override ) { /**
     * Is hash object
     * @param {Object} value - Test value
     * @returns {boolean} Result
     */ function isHashObject ( value ) { return typeof value === "object" && value instanceof Object && ! ( value instanceof Array ) && ! ( value instanceof RegExp ) ; } for ( const key in override ) { if ( override . hasOwnProperty ( key ) ) { const val = override [ key ] ; if ( isHashObject ( val ) ) { if ( isHashObject ( target [ key ] ) ) { updateDeeply ( target [ key ] , val ) ; } else { target [ key ] = updateDeeply ( { } , val ) ; } } else { target [ key ] = val ; } } } return target ; }
Preform deep update on option object
@param {Object} target - Options
@param {Object} override - Updates
@returns {Object} Updated options
Preform deep update on option object