Home / Function/ addContentTypeParser() — fastify Function Reference

addContentTypeParser() — fastify Function Reference

Architecture documentation for the addContentTypeParser() function in content-type-parser.js from the fastify codebase.

Entity Profile

Dependency Diagram

graph TD
  edbc058c_128e_1ef0_93ce_0bf3b13c664a["addContentTypeParser()"]
  b47c11f3_fe3b_64dc_0f58_921e5921ec45["content-type-parser.js"]
  edbc058c_128e_1ef0_93ce_0bf3b13c664a -->|defined in| b47c11f3_fe3b_64dc_0f58_921e5921ec45
  0263d1e1_98f0_1273_d326_dcda379097b2["add()"]
  edbc058c_128e_1ef0_93ce_0bf3b13c664a -->|calls| 0263d1e1_98f0_1273_d326_dcda379097b2
  style edbc058c_128e_1ef0_93ce_0bf3b13c664a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

lib/content-type-parser.js lines 344–364

function addContentTypeParser (contentType, opts, parser) {
  if (this[kState].started) {
    throw new FST_ERR_CTP_INSTANCE_ALREADY_STARTED('addContentTypeParser')
  }

  if (typeof opts === 'function') {
    parser = opts
    opts = {}
  }

  if (!opts) opts = {}
  if (!opts.bodyLimit) opts.bodyLimit = this[kBodyLimit]

  if (Array.isArray(contentType)) {
    contentType.forEach((type) => this[kContentTypeParser].add(type, opts, parser))
  } else {
    this[kContentTypeParser].add(contentType, opts, parser)
  }

  return this
}

Domain

Subdomains

Calls

Frequently Asked Questions

What does addContentTypeParser() do?
addContentTypeParser() is a function in the fastify codebase, defined in lib/content-type-parser.js.
Where is addContentTypeParser() defined?
addContentTypeParser() is defined in lib/content-type-parser.js at line 344.
What does addContentTypeParser() call?
addContentTypeParser() calls 1 function(s): add.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free