lib/util.js
function (entity, options) {
        var type,
            result,
            self = this,
            auth = self.cleanAuth(entity, options);

        if (!auth) { return auth; }

        result = { type: (type = auth.type) };

        if (type !== 'noauth') {
            result[type] = _.transform(auth[type], function (result, param) {
                result[param.key] = param.value;
            }, {});
        }

        return result;
    }
function (entity, options) {
        var type,
            result,
            self = this,
            auth = self.cleanAuth(entity, options);

        if (!auth) { return auth; }

        result = { type: (type = auth.type) };

        if (type !== 'noauth') {
            result[type] = _.transform(auth[type], function (result, param) {
                result[param.key] = param.value;
            }, {});
        }

        return result;
    }
function ( entity , options ) { var type , result , self = this , auth = self . cleanAuth ( entity , options ) ; if ( ! auth ) { return auth ; } result = { type : ( type = auth . type ) } ; if ( type !== 'noauth' ) { result [ type ] = _ . transform ( auth [ type ] , function ( result , param ) { result [ param . key ] = param . value ; } , { } ) ; } return result ; }
Transforms an array of auth params to their object equivalent.

@param {Object} entity - The wrapper object for the array of auth params.
@param {?Object} options - The set of options for the current auth cleansing operation.
@param {?Boolean} [options.excludeNoauth=false] - When set to true, noauth is set to null.
@returns {*}
Transforms an array of auth params to their object equivalent .