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

Function typeFunction

test/utils.js:202–202  ·  view source on GitHub ↗
(req)

Source from the content-addressed store, hash-verified

200
201 it('should use function defaultType directly as the request content-type checker', () => {
202 const typeFunction = (req) => req.headers['content-type'].endsWith('+json')
203 const result = normalizeOptions({}, typeFunction)
204 assert.strictEqual(result.shouldParse, typeFunction)
205 assert.strictEqual(result.shouldParse({ headers: { 'content-type': 'application/ld+json' } }), true)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected