MCPcopy
hub / github.com/axios/axios / inherits

Function inherits

lib/utils.js:573–587  ·  view source on GitHub ↗
(constructor, superConstructor, props, descriptors)

Source from the content-addressed store, hash-verified

571 * @returns {void}
572 */
573const inherits = (constructor, superConstructor, props, descriptors) => {
574 constructor.prototype = Object.create(superConstructor.prototype, descriptors);
575 Object.defineProperty(constructor.prototype, 'constructor', {
576 __proto__: null,
577 value: constructor,
578 writable: true,
579 enumerable: false,
580 configurable: true,
581 });
582 Object.defineProperty(constructor, 'super', {
583 __proto__: null,
584 value: superConstructor.prototype,
585 });
586 props && Object.assign(constructor.prototype, props);
587};
588
589/**
590 * Resolve object with deep prototype chain to a flat object

Callers

nothing calls this directly

Calls 1

createMethod · 0.80

Tested by

no test coverage detected