index.js
function auth (req) {
  if (!req) {
    throw new TypeError('argument req is required')
  }

  if (typeof req !== 'object') {
    throw new TypeError('argument req is required to be an object')
  }

  // get header
  var header = getAuthorization(req)

  // parse header
  return parse(header)
}
function auth (req) {
  if (!req) {
    throw new TypeError('argument req is required')
  }

  if (typeof req !== 'object') {
    throw new TypeError('argument req is required to be an object')
  }

  // get header
  var header = getAuthorization(req)

  // parse header
  return parse(header)
}
function auth ( req ) { if ( ! req ) { throw new TypeError ( 'argument req is required' ) } if ( typeof req !== 'object' ) { throw new TypeError ( 'argument req is required to be an object' ) } // get header var header = getAuthorization ( req ) // parse header return parse ( header ) }
Parse the Authorization header field of a request.

@param {object} req
@return {object} with .name and .pass
@public
Parse the Authorization header field of a request .