lib/utils.js
function extend(a, b, noClone) { // A extends B
    a = a || {};

    if (typeof a !== 'object') {
        return noClone ? b : clone(b);
    }

    if (typeof b !== 'object') {
        return b;
    }

    if (!noClone) {
        a = clone(a);
    }

    Object.keys(b).forEach(function (key) {
        if (!a.hasOwnProperty(key) ||
            (!(typeof b[key] === 'object' && b[key].length === undefined && b[key].constructor.name === 'Folder') &&
                (typeof b[key] !== 'function'))) { // Simple types
            a[key] = b[key];
        } else { // Complex types
            a[key] = extend(a[key], b[key], noClone);
        }
    });
    return a;
}
function extend(a, b, noClone) { // A extends B
    a = a || {};

    if (typeof a !== 'object') {
        return noClone ? b : clone(b);
    }

    if (typeof b !== 'object') {
        return b;
    }

    if (!noClone) {
        a = clone(a);
    }

    Object.keys(b).forEach(function (key) {
        if (!a.hasOwnProperty(key) ||
            (!(typeof b[key] === 'object' && b[key].length === undefined && b[key].constructor.name === 'Folder') &&
                (typeof b[key] !== 'function'))) { // Simple types
            a[key] = b[key];
        } else { // Complex types
            a[key] = extend(a[key], b[key], noClone);
        }
    });
    return a;
}
function extend ( a , b , noClone ) { // A extends B a = a || { } ; if ( typeof a !== 'object' ) { return noClone ? b : clone ( b ) ; } if ( typeof b !== 'object' ) { return b ; } if ( ! noClone ) { a = clone ( a ) ; } Object . keys ( b ) . forEach ( function ( key ) { if ( ! a . hasOwnProperty ( key ) || ( ! ( typeof b [ key ] === 'object' && b [ key ] . length === undefined && b [ key ] . constructor . name === 'Folder' ) && ( typeof b [ key ] !== 'function' ) ) ) { // Simple types a [ key ] = b [ key ] ; } else { // Complex types a [ key ] = extend ( a [ key ] , b [ key ] , noClone ) ; } } ) ; return a ; }
A extends B

util.inherits works only with objects derived from Object

@return {Object} Extended object
A extends B