MCPcopy
hub / github.com/axios/axios / normalize

Method normalize

lib/core/AxiosHeaders.js:230–255  ·  lib/core/AxiosHeaders.js::AxiosHeaders.normalize
(format)

Source from the content-addressed store, hash-verified

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);

Callers 5

transformDataFunction · 0.80
factoryFunction · 0.80
xhr.jsFile · 0.80
http.jsFile · 0.80

Calls 3

normalizeValueFunction · 0.85
formatHeaderFunction · 0.85
forEachMethod · 0.80

Tested by

no test coverage detected