demo/body-parser/lib/types/urlencoded.js
function extendedparser (options) {
  var parameterLimit = options.parameterLimit !== undefined
    ? options.parameterLimit
    : 1000
  var parse = parser('qs')

  if (isNaN(parameterLimit) || parameterLimit < 1) {
    throw new TypeError('option parameterLimit must be a positive number')
  }

  if (isFinite(parameterLimit)) {
    parameterLimit = parameterLimit | 0
  }

  return function queryparse (body) {
    var paramCount = parameterCount(body, parameterLimit)

    if (paramCount === undefined) {
      debug('too many parameters')
      throw createError(413, 'too many parameters')
    }

    var arrayLimit = Math.max(100, paramCount)

    debug('parse extended urlencoding')
    return parse(body, {
      allowPrototypes: true,
      arrayLimit: arrayLimit,
      depth: Infinity,
      parameterLimit: parameterLimit
    })
  }
}
function extendedparser (options) {
  var parameterLimit = options.parameterLimit !== undefined
    ? options.parameterLimit
    : 1000
  var parse = parser('qs')

  if (isNaN(parameterLimit) || parameterLimit < 1) {
    throw new TypeError('option parameterLimit must be a positive number')
  }

  if (isFinite(parameterLimit)) {
    parameterLimit = parameterLimit | 0
  }

  return function queryparse (body) {
    var paramCount = parameterCount(body, parameterLimit)

    if (paramCount === undefined) {
      debug('too many parameters')
      throw createError(413, 'too many parameters')
    }

    var arrayLimit = Math.max(100, paramCount)

    debug('parse extended urlencoding')
    return parse(body, {
      allowPrototypes: true,
      arrayLimit: arrayLimit,
      depth: Infinity,
      parameterLimit: parameterLimit
    })
  }
}
function extendedparser ( options ) { var parameterLimit = options . parameterLimit !== undefined ? options . parameterLimit : 1000 var parse = parser ( 'qs' ) if ( isNaN ( parameterLimit ) || parameterLimit < 1 ) { throw new TypeError ( 'option parameterLimit must be a positive number' ) } if ( isFinite ( parameterLimit ) ) { parameterLimit = parameterLimit | 0 } return function queryparse ( body ) { var paramCount = parameterCount ( body , parameterLimit ) if ( paramCount === undefined ) { debug ( 'too many parameters' ) throw createError ( 413 , 'too many parameters' ) } var arrayLimit = Math . max ( 100 , paramCount ) debug ( 'parse extended urlencoding' ) return parse ( body , { allowPrototypes : true , arrayLimit : arrayLimit , depth : Infinity , parameterLimit : parameterLimit } ) } }
Get the extended query parser.

@param {object} options
Get the extended query parser .