index.js
function type (response) {
  return value => {
    if (!(value instanceof Error)) {
      response.setHeader(
        'Content-Type',
        lookup(typeof value === 'object' ? 'json' : 'text')
      )
    }
    return value instanceof Array ? JSON.stringify(value) : value
  }
}
function type (response) {
  return value => {
    if (!(value instanceof Error)) {
      response.setHeader(
        'Content-Type',
        lookup(typeof value === 'object' ? 'json' : 'text')
      )
    }
    return value instanceof Array ? JSON.stringify(value) : value
  }
}
function type ( response ) { return value => { if ( ! ( value instanceof Error ) ) { response . setHeader ( 'Content-Type' , lookup ( typeof value === 'object' ? 'json' : 'text' ) ) } return value instanceof Array ? JSON . stringify ( value ) : value } }
Set response content type header.

@param {Object} response
@return {Function}
@api private
Set response content type header .