axios 0.33.0 → 0.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/utils.js CHANGED
@@ -393,6 +393,15 @@ function stripBOM(content) {
393
393
  return content;
394
394
  }
395
395
 
396
+ function defineOwnProperty(target, key, value) {
397
+ var descriptor = Object.create(null);
398
+ descriptor.value = value;
399
+ descriptor.writable = true;
400
+ descriptor.enumerable = true;
401
+ descriptor.configurable = true;
402
+ Object.defineProperty(target, key, descriptor);
403
+ }
404
+
396
405
  /**
397
406
  * Inherit the prototype methods from one constructor into another
398
407
  * @param {function} constructor
@@ -400,14 +409,35 @@ function stripBOM(content) {
400
409
  * @param {object} [props]
401
410
  * @param {object} [descriptors]
402
411
  */
403
-
404
412
  function inherits(constructor, superConstructor, props, descriptors) {
405
413
  constructor.prototype = Object.create(
406
414
  superConstructor.prototype,
407
415
  descriptors
408
416
  );
409
- constructor.prototype.constructor = constructor;
410
- props && Object.assign(constructor.prototype, props);
417
+ if (Object.prototype.hasOwnProperty.call(constructor.prototype, 'constructor')) {
418
+ constructor.prototype.constructor = constructor;
419
+ } else {
420
+ defineOwnProperty(constructor.prototype, 'constructor', constructor);
421
+ }
422
+
423
+ if (props) {
424
+ var keys = Object.keys(props);
425
+ if (Object.getOwnPropertySymbols) {
426
+ keys = keys.concat(Object.getOwnPropertySymbols(props).filter(function(key) {
427
+ return Object.prototype.propertyIsEnumerable.call(props, key);
428
+ }));
429
+ }
430
+ keys.forEach(function(key) {
431
+ var value = props[key];
432
+ if (Object.prototype.hasOwnProperty.call(constructor.prototype, key)) {
433
+ constructor.prototype[key] = value;
434
+ } else {
435
+ // Assignment would invoke an inherited setter or fail on a read-only
436
+ // property installed by another library, such as Error.prototype.toJSON.
437
+ defineOwnProperty(constructor.prototype, key, value);
438
+ }
439
+ });
440
+ }
411
441
  }
412
442
 
413
443
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "axios",
3
- "version": "0.33.0",
3
+ "version": "0.34.0",
4
4
  "description": "Promise based HTTP client for the browser and node.js",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",