Home / Function/ hasParser() — fastify Function Reference

hasParser() — fastify Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

lib/content-type-parser.js lines 94–103

ContentTypeParser.prototype.hasParser = function (contentType) {
  if (typeof contentType === 'string') {
    contentType = new ContentType(contentType).toString()
  } else {
    if (!(contentType instanceof RegExp)) throw new FST_ERR_CTP_INVALID_TYPE()
    contentType = contentType.toString()
  }

  return this.customParsers.has(contentType)
}

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free