Home / Function/ toString() — fastify Function Reference

toString() — fastify Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  83f1f999_592b_41ff_4a73_042315c5432a["toString()"]
  478e364f_b024_741a_f140_dbb777da4660["ContentType"]
  83f1f999_592b_41ff_4a73_042315c5432a -->|defined in| 478e364f_b024_741a_f140_dbb777da4660
  style 83f1f999_592b_41ff_4a73_042315c5432a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

lib/content-type.js lines 135–149

  toString () {
    /* c8 ignore next: we don't need to verify the cache */
    if (this.#string) return this.#string
    const parameters = []
    for (const [key, value] of this.#parameters.entries()) {
      parameters.push(`${key}="${value}"`)
    }
    const result = [this.#type, '/', this.#subtype]
    if (parameters.length > 0) {
      result.push('; ')
      result.push(parameters.join('; '))
    }
    this.#string = result.join('')
    return this.#string
  }

Domain

Subdomains

Defined In

Frequently Asked Questions

What does toString() do?
toString() is a function in the fastify codebase, defined in lib/content-type.js.
Where is toString() defined?
toString() is defined in lib/content-type.js at line 135.

Analyze Your Own Codebase

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

Try Supermodel Free