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

Function parser

lib/types/urlencoded.js:215–236  ·  view source on GitHub ↗

* Get parser for module name dynamically. * * @param {string} name * @return {function} * @api private

(name)

Source from the content-addressed store, hash-verified

213 */
214
215function parser (name) {
216 var mod = parsers[name]
217
218 if (mod !== undefined) {
219 return mod.parse
220 }
221
222 // this uses a switch for static require analysis
223 switch (name) {
224 case 'qs':
225 mod = require('qs')
226 break
227 case 'querystring':
228 mod = require('querystring')
229 break
230 }
231
232 // store to prevent invoking require()
233 parsers[name] = mod
234
235 return mod.parse
236}
237
238/**
239 * Get the simple query parser.

Callers 2

extendedparserFunction · 0.85
simpleparserFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected