index.js
function status (code) {
  if (typeof code === 'number') {
    if (!status[code]) throw new Error('invalid status code: ' + code)
    return code
  }

  if (typeof code !== 'string') {
    throw new TypeError('code must be a number or string')
  }

  // '403'
  var n = parseInt(code, 10)
  if (!isNaN(n)) {
    if (!status[n]) throw new Error('invalid status code: ' + n)
    return n
  }

  n = status[code.toLowerCase()]
  if (!n) throw new Error('invalid status message: "' + code + '"')
  return n
}
function status (code) {
  if (typeof code === 'number') {
    if (!status[code]) throw new Error('invalid status code: ' + code)
    return code
  }

  if (typeof code !== 'string') {
    throw new TypeError('code must be a number or string')
  }

  // '403'
  var n = parseInt(code, 10)
  if (!isNaN(n)) {
    if (!status[n]) throw new Error('invalid status code: ' + n)
    return n
  }

  n = status[code.toLowerCase()]
  if (!n) throw new Error('invalid status message: "' + code + '"')
  return n
}
function status ( code ) { if ( typeof code === 'number' ) { if ( ! status [ code ] ) throw new Error ( 'invalid status code: ' + code ) return code } if ( typeof code !== 'string' ) { throw new TypeError ( 'code must be a number or string' ) } // '403' var n = parseInt ( code , 10 ) if ( ! isNaN ( n ) ) { if ( ! status [ n ] ) throw new Error ( 'invalid status code: ' + n ) return n } n = status [ code . toLowerCase ( ) ] if ( ! n ) throw new Error ( 'invalid status message: "' + code + '"' ) return n }
Get the status code.

Given a number, this will throw if it is not a known status
code, otherwise the code will be returned. Given a string,
the string will be parsed for a number and return the code
if valid, otherwise will lookup the code assuming this is
the status message.

@param {string|number} code
@returns {number}
@public
Get the status code .