MCPcopy Create free account
hub / github.com/expressjs/body-parser / parameterCount

Function parameterCount

lib/types/urlencoded.js:191–205  ·  view source on GitHub ↗

* Count the number of parameters, stopping once limit reached * * @param {string} body * @param {number} limit * @api private

(body, limit)

Source from the content-addressed store, hash-verified

189 */
190
191function parameterCount (body, limit) {
192 var count = 0
193 var index = 0
194
195 while ((index = body.indexOf('&', index)) !== -1) {
196 count++
197 index++
198
199 if (count === limit) {
200 return undefined
201 }
202 }
203
204 return count
205}
206
207/**
208 * Get parser for module name dynamically.

Callers 2

extendedparserFunction · 0.85
simpleparserFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected