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

  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')
    }

    debug('parse urlencoding')
    return parse(body, undefined, undefined, {maxKeys: parameterLimit})
  }
}
function simpleparser (options) {
  var parameterLimit = options.parameterLimit !== undefined
    ? options.parameterLimit
    : 1000
  var parse = parser('querystring')

  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')
    }

    debug('parse urlencoding')
    return parse(body, undefined, undefined, {maxKeys: parameterLimit})
  }
}
function simpleparser ( options ) { var parameterLimit = options . parameterLimit !== undefined ? options . parameterLimit : 1000 var parse = parser ( 'querystring' ) 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' ) } debug ( 'parse urlencoding' ) return parse ( body , undefined , undefined , { maxKeys : parameterLimit } ) } }
Get the simple query parser.

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