lib/templateUtils.js
function(template, delta, overrideName) {
    if (template.name !== delta.name) {
        if (!overrideName) {
            var err = new Error('mergeObj: description names do not match');
            err['template'] = template;
            err['delta'] = delta;
            throw err;
        }
    }

    /** @type specType*/
    var result = {
        name: delta.name || template.name,
        module: (delta.module ? delta.module : template.module),
        description: (delta.description ? delta.description :
                      template.description),
        env: mergeEnv(template.env, delta.env || {})
    };

    if (template.components || delta.components) {
        result.components = mergeComponents(template.components || [],
                                            delta.components || []);
    }
    return result;
}
function(template, delta, overrideName) {
    if (template.name !== delta.name) {
        if (!overrideName) {
            var err = new Error('mergeObj: description names do not match');
            err['template'] = template;
            err['delta'] = delta;
            throw err;
        }
    }

    /** @type specType*/
    var result = {
        name: delta.name || template.name,
        module: (delta.module ? delta.module : template.module),
        description: (delta.description ? delta.description :
                      template.description),
        env: mergeEnv(template.env, delta.env || {})
    };

    if (template.components || delta.components) {
        result.components = mergeComponents(template.components || [],
                                            delta.components || []);
    }
    return result;
}
function ( template , delta , overrideName ) { if ( template . name !== delta . name ) { if ( ! overrideName ) { var err = new Error ( 'mergeObj: description names do not match' ) ; err [ 'template' ] = template ; err [ 'delta' ] = delta ; throw err ; } } /** @type specType*/ var result = { name : delta . name || template . name , module : ( delta . module ? delta . module : template . module ) , description : ( delta . description ? delta . description : template . description ) , env : mergeEnv ( template . env , delta . env || { } ) } ; if ( template . components || delta . components ) { result . components = mergeComponents ( template . components || [ ] , delta . components || [ ] ) ; } return result ; }
Merge two descriptions with the same name.


@param {specType} template
@param {specDeltaType} delta
@param {boolean} overrideName
@return {specType} result
Merge two descriptions with the same name .