()
| 141 | get parameters () { return this.#parameters } |
| 142 | |
| 143 | toString () { |
| 144 | /* c8 ignore next: we don't need to verify the cache */ |
| 145 | if (this.#string) return this.#string |
| 146 | const parameters = [] |
| 147 | for (const [key, value] of this.#parameters.entries()) { |
| 148 | parameters.push(`${key}="${value}"`) |
| 149 | } |
| 150 | const result = [this.#type, '/', this.#subtype] |
| 151 | if (parameters.length > 0) { |
| 152 | result.push('; ') |
| 153 | result.push(parameters.join('; ')) |
| 154 | } |
| 155 | this.#string = result.join('') |
| 156 | return this.#string |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | module.exports = ContentType |
no outgoing calls