MCPcopy Create free account
hub / github.com/fastify/fastify / toString

Method toString

lib/content-type.js:176–190  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

174 get parameters () { return this.#parameters }
175
176 toString () {
177 /* c8 ignore next: we don't need to verify the cache */
178 if (this.#string) return this.#string
179 const parameters = []
180 for (const [key, value] of this.#parameters.entries()) {
181 parameters.push(`${key}="${value}"`)
182 }
183 const result = [this.#type, '/', this.#subtype]
184 if (parameters.length > 0) {
185 result.push('; ')
186 result.push(parameters.join('; '))
187 }
188 this.#string = result.join('')
189 return this.#string
190 }
191}
192
193module.exports = ContentType

Callers 15

buildDefaultGenReqIdFunction · 0.80
handleRequestFunction · 0.80
anonymous0Function · 0.80
toJSONFunction · 0.80
reply.jsFile · 0.80
getFuncPreviewFunction · 0.80
delete.test.jsFile · 0.80
404s.test.jsFile · 0.80

Calls

no outgoing calls

Tested by 2

optGenReqIdFunction · 0.64
fnFunction · 0.64