index.js
function originalurl (req) {
  var url = req.originalUrl

  if (typeof url !== 'string') {
    // Fallback
    return parseurl(req)
  }

  var parsed = req._parsedOriginalUrl

  if (fresh(url, parsed)) {
    // Return cached URL parse
    return parsed
  }

  // Parse the URL
  parsed = fastparse(url)
  parsed._raw = url

  return (req._parsedOriginalUrl = parsed)
}
function originalurl (req) {
  var url = req.originalUrl

  if (typeof url !== 'string') {
    // Fallback
    return parseurl(req)
  }

  var parsed = req._parsedOriginalUrl

  if (fresh(url, parsed)) {
    // Return cached URL parse
    return parsed
  }

  // Parse the URL
  parsed = fastparse(url)
  parsed._raw = url

  return (req._parsedOriginalUrl = parsed)
}
function originalurl ( req ) { var url = req . originalUrl if ( typeof url !== 'string' ) { // Fallback return parseurl ( req ) } var parsed = req . _parsedOriginalUrl if ( fresh ( url , parsed ) ) { // Return cached URL parse return parsed } // Parse the URL parsed = fastparse ( url ) parsed . _raw = url return ( req . _parsedOriginalUrl = parsed ) }
Parse the `req` original url with fallback and memoization.

@param {ServerRequest} req
@return {Object}
@public
Parse the req original url with fallback and memoization .