Home / Function/ remove() — fastify Function Reference

remove() — fastify Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  4b03b8fc_4598_2d56_a9c9_4aa5da0e0ba6["remove()"]
  b47c11f3_fe3b_64dc_0f58_921e5921ec45["content-type-parser.js"]
  4b03b8fc_4598_2d56_a9c9_4aa5da0e0ba6 -->|defined in| b47c11f3_fe3b_64dc_0f58_921e5921ec45
  2ef7be2d_39ac_4e25_0ccc_3bd4ef9a3796["removeContentTypeParser()"]
  2ef7be2d_39ac_4e25_0ccc_3bd4ef9a3796 -->|calls| 4b03b8fc_4598_2d56_a9c9_4aa5da0e0ba6
  style 4b03b8fc_4598_2d56_a9c9_4aa5da0e0ba6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

lib/content-type-parser.js lines 163–183

ContentTypeParser.prototype.remove = function (contentType) {
  let parsers

  if (typeof contentType === 'string') {
    contentType = new ContentType(contentType).toString()
    parsers = this.parserList
  } else {
    if (!(contentType instanceof RegExp)) throw new FST_ERR_CTP_INVALID_TYPE()
    contentType = contentType.toString()
    parsers = this.parserRegExpList
  }

  const removed = this.customParsers.delete(contentType)
  const idx = parsers.findIndex(ct => ct.toString() === contentType)

  if (idx > -1) {
    parsers.splice(idx, 1)
  }

  return removed || idx > -1
}

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free