(format)
| 228 | } |
| 229 | |
| 230 | normalize(format) { |
| 231 | const self = this; |
| 232 | const headers = {}; |
| 233 | |
| 234 | utils.forEach(this, (value, header) => { |
| 235 | const key = utils.findKey(headers, header); |
| 236 | |
| 237 | if (key) { |
| 238 | self[key] = normalizeValue(value); |
| 239 | delete self[header]; |
| 240 | return; |
| 241 | } |
| 242 | |
| 243 | const normalized = format ? formatHeader(header) : String(header).trim(); |
| 244 | |
| 245 | if (normalized !== header) { |
| 246 | delete self[header]; |
| 247 | } |
| 248 | |
| 249 | self[normalized] = normalizeValue(value); |
| 250 | |
| 251 | headers[normalized] = true; |
| 252 | }); |
| 253 | |
| 254 | return this; |
| 255 | } |
| 256 | |
| 257 | concat(...targets) { |
| 258 | return this.constructor.concat(this, ...targets); |
no test coverage detected