MCPcopy
hub / github.com/axios/axios / toJSON

Method toJSON

lib/core/AxiosHeaders.js:261–271  ·  view source on GitHub ↗
(asStrings)

Source from the content-addressed store, hash-verified

259 }
260
261 toJSON(asStrings) {
262 const obj = Object.create(null);
263
264 utils.forEach(this, (value, header) => {
265 value != null &&
266 value !== false &&
267 (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);
268 });
269
270 return obj;
271 }
272
273 [Symbol.iterator]() {
274 return Object.entries(this.toJSON())[Symbol.iterator]();

Callers 2

[Symbol.iterator]Method · 0.95
toStringMethod · 0.95

Calls 2

createMethod · 0.80
forEachMethod · 0.80

Tested by

no test coverage detected