pipe/plumber.js
function (defaults, attr, custom) {
        var resolvedPath;

        if (defaults === undefined || defaults[attr] === undefined) {
            throw new Error('Missing Parameter', 'Expect a given defaults object');
        }

        if (attr === undefined) {
            throw new Error('Missing Parameter', 'Expect a given attribute');
        }

        if (custom === undefined || custom[attr] === undefined) {
            resolvedPath = path.resolve(defaults[attr]);
        } else {
            resolvedPath = path.resolve(custom[attr]);
        }

        return resolvedPath;
    }
function (defaults, attr, custom) {
        var resolvedPath;

        if (defaults === undefined || defaults[attr] === undefined) {
            throw new Error('Missing Parameter', 'Expect a given defaults object');
        }

        if (attr === undefined) {
            throw new Error('Missing Parameter', 'Expect a given attribute');
        }

        if (custom === undefined || custom[attr] === undefined) {
            resolvedPath = path.resolve(defaults[attr]);
        } else {
            resolvedPath = path.resolve(custom[attr]);
        }

        return resolvedPath;
    }
function ( defaults , attr , custom ) { var resolvedPath ; if ( defaults === undefined || defaults [ attr ] === undefined ) { throw new Error ( 'Missing Parameter' , 'Expect a given defaults object' ) ; } if ( attr === undefined ) { throw new Error ( 'Missing Parameter' , 'Expect a given attribute' ) ; } if ( custom === undefined || custom [ attr ] === undefined ) { resolvedPath = path . resolve ( defaults [ attr ] ) ; } else { resolvedPath = path . resolve ( custom [ attr ] ) ; } return resolvedPath ; }
Retrieving a resolved path from defaults or custom options
@param  {Object} defaults    Fallback options
@param  {String} attr        Attribute to be resolved
@param  {Object} custom      Custom options
@return {String}             Resolved path from custom options or default if undefined
Retrieving a resolved path from defaults or custom options