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

Method from

lib/content-type.js:73–79  ·  view source on GitHub ↗

* Create a ContentType instance from a header value. If the value has been * previously parsed, the cached instance will be returned. * @param {string} headerValue * @returns {ContentType | undefined}

(headerValue)

Source from the content-addressed store, hash-verified

71 * @returns {ContentType | undefined}
72 */
73 static from (headerValue) {
74 let contentType = cache.get(headerValue)
75 if (contentType !== undefined) return contentType
76 contentType = new ContentType(headerValue)
77 cache.set(headerValue, contentType)
78 return contentType
79 }
80
81 constructor (headerValue) {
82 if (headerValue == null || headerValue === '' || headerValue === 'undefined') {

Callers 15

handleRequestFunction · 0.80
reply.jsFile · 0.80
writeHttp2PayloadFunction · 0.80
getFunction · 0.80
route.6.test.jsFile · 0.80
route.7.test.jsFile · 0.80
stream.3.test.jsFile · 0.80
stream.4.test.jsFile · 0.80
hooks.test.jsFile · 0.80
web-api.test.jsFile · 0.80
startFunction · 0.80
pullFunction · 0.80

Calls

no outgoing calls

Tested by 2

startFunction · 0.64
pullFunction · 0.64