Home / Function/ existingParser() — fastify Function Reference

existingParser() — fastify Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

lib/content-type-parser.js lines 105–117

ContentTypeParser.prototype.existingParser = function (contentType) {
  if (typeof contentType === 'string') {
    const ct = new ContentType(contentType).toString()
    if (contentType === 'application/json' && this.customParsers.has(contentType)) {
      return this.customParsers.get(ct).fn !== this[kDefaultJsonParse]
    }
    if (contentType === 'text/plain' && this.customParsers.has(contentType)) {
      return this.customParsers.get(ct).fn !== defaultPlainTextParser
    }
  }

  return this.hasParser(contentType)
}

Domain

Subdomains

Calls

Called By

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free