axios 0.18.1 → 0.19.2

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.

Potentially problematic release.


This version of axios might be problematic. Click here for more details.

package/dist/axios.js CHANGED
@@ -1,4 +1,4 @@
1
- /* axios v0.18.1 | (c) 2019 by Matt Zabriskie */
1
+ /* axios v0.19.2 | (c) 2020 by Matt Zabriskie */
2
2
  (function webpackUniversalModuleDefinition(root, factory) {
3
3
  if(typeof exports === 'object' && typeof module === 'object')
4
4
  module.exports = factory();
@@ -65,8 +65,9 @@ return /******/ (function(modules) { // webpackBootstrap
65
65
 
66
66
  var utils = __webpack_require__(2);
67
67
  var bind = __webpack_require__(3);
68
- var Axios = __webpack_require__(5);
69
- var defaults = __webpack_require__(6);
68
+ var Axios = __webpack_require__(4);
69
+ var mergeConfig = __webpack_require__(22);
70
+ var defaults = __webpack_require__(10);
70
71
 
71
72
  /**
72
73
  * Create an instance of Axios
@@ -95,19 +96,19 @@ return /******/ (function(modules) { // webpackBootstrap
95
96
 
96
97
  // Factory for creating new instances
97
98
  axios.create = function create(instanceConfig) {
98
- return createInstance(utils.merge(defaults, instanceConfig));
99
+ return createInstance(mergeConfig(axios.defaults, instanceConfig));
99
100
  };
100
101
 
101
102
  // Expose Cancel & CancelToken
102
- axios.Cancel = __webpack_require__(22);
103
- axios.CancelToken = __webpack_require__(23);
104
- axios.isCancel = __webpack_require__(19);
103
+ axios.Cancel = __webpack_require__(23);
104
+ axios.CancelToken = __webpack_require__(24);
105
+ axios.isCancel = __webpack_require__(9);
105
106
 
106
107
  // Expose all/spread
107
108
  axios.all = function all(promises) {
108
109
  return Promise.all(promises);
109
110
  };
110
- axios.spread = __webpack_require__(24);
111
+ axios.spread = __webpack_require__(25);
111
112
 
112
113
  module.exports = axios;
113
114
 
@@ -122,7 +123,6 @@ return /******/ (function(modules) { // webpackBootstrap
122
123
  'use strict';
123
124
 
124
125
  var bind = __webpack_require__(3);
125
- var isBuffer = __webpack_require__(4);
126
126
 
127
127
  /*global toString:true*/
128
128
 
@@ -140,6 +140,27 @@ return /******/ (function(modules) { // webpackBootstrap
140
140
  return toString.call(val) === '[object Array]';
141
141
  }
142
142
 
143
+ /**
144
+ * Determine if a value is undefined
145
+ *
146
+ * @param {Object} val The value to test
147
+ * @returns {boolean} True if the value is undefined, otherwise false
148
+ */
149
+ function isUndefined(val) {
150
+ return typeof val === 'undefined';
151
+ }
152
+
153
+ /**
154
+ * Determine if a value is a Buffer
155
+ *
156
+ * @param {Object} val The value to test
157
+ * @returns {boolean} True if value is a Buffer, otherwise false
158
+ */
159
+ function isBuffer(val) {
160
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
161
+ && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
162
+ }
163
+
143
164
  /**
144
165
  * Determine if a value is an ArrayBuffer
145
166
  *
@@ -196,16 +217,6 @@ return /******/ (function(modules) { // webpackBootstrap
196
217
  return typeof val === 'number';
197
218
  }
198
219
 
199
- /**
200
- * Determine if a value is undefined
201
- *
202
- * @param {Object} val The value to test
203
- * @returns {boolean} True if the value is undefined, otherwise false
204
- */
205
- function isUndefined(val) {
206
- return typeof val === 'undefined';
207
- }
208
-
209
220
  /**
210
221
  * Determine if a value is an Object
211
222
  *
@@ -298,9 +309,13 @@ return /******/ (function(modules) { // webpackBootstrap
298
309
  *
299
310
  * react-native:
300
311
  * navigator.product -> 'ReactNative'
312
+ * nativescript
313
+ * navigator.product -> 'NativeScript' or 'NS'
301
314
  */
302
315
  function isStandardBrowserEnv() {
303
- if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
316
+ if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
317
+ navigator.product === 'NativeScript' ||
318
+ navigator.product === 'NS')) {
304
319
  return false;
305
320
  }
306
321
  return (
@@ -381,6 +396,32 @@ return /******/ (function(modules) { // webpackBootstrap
381
396
  return result;
382
397
  }
383
398
 
399
+ /**
400
+ * Function equal to merge with the difference being that no reference
401
+ * to original objects is kept.
402
+ *
403
+ * @see merge
404
+ * @param {Object} obj1 Object to merge
405
+ * @returns {Object} Result of all merge properties
406
+ */
407
+ function deepMerge(/* obj1, obj2, obj3, ... */) {
408
+ var result = {};
409
+ function assignValue(val, key) {
410
+ if (typeof result[key] === 'object' && typeof val === 'object') {
411
+ result[key] = deepMerge(result[key], val);
412
+ } else if (typeof val === 'object') {
413
+ result[key] = deepMerge({}, val);
414
+ } else {
415
+ result[key] = val;
416
+ }
417
+ }
418
+
419
+ for (var i = 0, l = arguments.length; i < l; i++) {
420
+ forEach(arguments[i], assignValue);
421
+ }
422
+ return result;
423
+ }
424
+
384
425
  /**
385
426
  * Extends object a by mutably adding to it the properties of object b.
386
427
  *
@@ -419,6 +460,7 @@ return /******/ (function(modules) { // webpackBootstrap
419
460
  isStandardBrowserEnv: isStandardBrowserEnv,
420
461
  forEach: forEach,
421
462
  merge: merge,
463
+ deepMerge: deepMerge,
422
464
  extend: extend,
423
465
  trim: trim
424
466
  };
@@ -443,31 +485,15 @@ return /******/ (function(modules) { // webpackBootstrap
443
485
 
444
486
  /***/ }),
445
487
  /* 4 */
446
- /***/ (function(module, exports) {
447
-
448
- /*!
449
- * Determine if an object is a Buffer
450
- *
451
- * @author Feross Aboukhadijeh <https://feross.org>
452
- * @license MIT
453
- */
454
-
455
- module.exports = function isBuffer (obj) {
456
- return obj != null && obj.constructor != null &&
457
- typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
458
- }
459
-
460
-
461
- /***/ }),
462
- /* 5 */
463
488
  /***/ (function(module, exports, __webpack_require__) {
464
489
 
465
490
  'use strict';
466
491
 
467
- var defaults = __webpack_require__(6);
468
492
  var utils = __webpack_require__(2);
469
- var InterceptorManager = __webpack_require__(16);
470
- var dispatchRequest = __webpack_require__(17);
493
+ var buildURL = __webpack_require__(5);
494
+ var InterceptorManager = __webpack_require__(6);
495
+ var dispatchRequest = __webpack_require__(7);
496
+ var mergeConfig = __webpack_require__(22);
471
497
 
472
498
  /**
473
499
  * Create a new instance of Axios
@@ -491,13 +517,22 @@ return /******/ (function(modules) { // webpackBootstrap
491
517
  /*eslint no-param-reassign:0*/
492
518
  // Allow for axios('example/url'[, config]) a la fetch API
493
519
  if (typeof config === 'string') {
494
- config = utils.merge({
495
- url: arguments[0]
496
- }, arguments[1]);
520
+ config = arguments[1] || {};
521
+ config.url = arguments[0];
522
+ } else {
523
+ config = config || {};
497
524
  }
498
525
 
499
- config = utils.merge(defaults, {method: 'get'}, this.defaults, config);
500
- config.method = config.method.toLowerCase();
526
+ config = mergeConfig(this.defaults, config);
527
+
528
+ // Set config.method
529
+ if (config.method) {
530
+ config.method = config.method.toLowerCase();
531
+ } else if (this.defaults.method) {
532
+ config.method = this.defaults.method.toLowerCase();
533
+ } else {
534
+ config.method = 'get';
535
+ }
501
536
 
502
537
  // Hook up interceptors middleware
503
538
  var chain = [dispatchRequest, undefined];
@@ -518,6 +553,11 @@ return /******/ (function(modules) { // webpackBootstrap
518
553
  return promise;
519
554
  };
520
555
 
556
+ Axios.prototype.getUri = function getUri(config) {
557
+ config = mergeConfig(this.defaults, config);
558
+ return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
559
+ };
560
+
521
561
  // Provide aliases for supported request methods
522
562
  utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
523
563
  /*eslint func-names:0*/
@@ -544,144 +584,403 @@ return /******/ (function(modules) { // webpackBootstrap
544
584
 
545
585
 
546
586
  /***/ }),
547
- /* 6 */
587
+ /* 5 */
548
588
  /***/ (function(module, exports, __webpack_require__) {
549
589
 
550
590
  'use strict';
551
591
 
552
592
  var utils = __webpack_require__(2);
553
- var normalizeHeaderName = __webpack_require__(7);
554
-
555
- var DEFAULT_CONTENT_TYPE = {
556
- 'Content-Type': 'application/x-www-form-urlencoded'
557
- };
558
593
 
559
- function setContentTypeIfUnset(headers, value) {
560
- if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
561
- headers['Content-Type'] = value;
562
- }
594
+ function encode(val) {
595
+ return encodeURIComponent(val).
596
+ replace(/%40/gi, '@').
597
+ replace(/%3A/gi, ':').
598
+ replace(/%24/g, '$').
599
+ replace(/%2C/gi, ',').
600
+ replace(/%20/g, '+').
601
+ replace(/%5B/gi, '[').
602
+ replace(/%5D/gi, ']');
563
603
  }
564
604
 
565
- function getDefaultAdapter() {
566
- var adapter;
567
- if (typeof XMLHttpRequest !== 'undefined') {
568
- // For browsers use XHR adapter
569
- adapter = __webpack_require__(8);
570
- } else if (typeof process !== 'undefined') {
571
- // For node use HTTP adapter
572
- adapter = __webpack_require__(8);
605
+ /**
606
+ * Build a URL by appending params to the end
607
+ *
608
+ * @param {string} url The base of the url (e.g., http://www.google.com)
609
+ * @param {object} [params] The params to be appended
610
+ * @returns {string} The formatted url
611
+ */
612
+ module.exports = function buildURL(url, params, paramsSerializer) {
613
+ /*eslint no-param-reassign:0*/
614
+ if (!params) {
615
+ return url;
573
616
  }
574
- return adapter;
575
- }
576
617
 
577
- var defaults = {
578
- adapter: getDefaultAdapter(),
618
+ var serializedParams;
619
+ if (paramsSerializer) {
620
+ serializedParams = paramsSerializer(params);
621
+ } else if (utils.isURLSearchParams(params)) {
622
+ serializedParams = params.toString();
623
+ } else {
624
+ var parts = [];
579
625
 
580
- transformRequest: [function transformRequest(data, headers) {
581
- normalizeHeaderName(headers, 'Content-Type');
582
- if (utils.isFormData(data) ||
583
- utils.isArrayBuffer(data) ||
584
- utils.isBuffer(data) ||
585
- utils.isStream(data) ||
586
- utils.isFile(data) ||
587
- utils.isBlob(data)
588
- ) {
589
- return data;
590
- }
591
- if (utils.isArrayBufferView(data)) {
592
- return data.buffer;
593
- }
594
- if (utils.isURLSearchParams(data)) {
595
- setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
596
- return data.toString();
597
- }
598
- if (utils.isObject(data)) {
599
- setContentTypeIfUnset(headers, 'application/json;charset=utf-8');
600
- return JSON.stringify(data);
601
- }
602
- return data;
603
- }],
626
+ utils.forEach(params, function serialize(val, key) {
627
+ if (val === null || typeof val === 'undefined') {
628
+ return;
629
+ }
604
630
 
605
- transformResponse: [function transformResponse(data) {
606
- /*eslint no-param-reassign:0*/
607
- if (typeof data === 'string') {
608
- try {
609
- data = JSON.parse(data);
610
- } catch (e) { /* Ignore */ }
611
- }
612
- return data;
613
- }],
631
+ if (utils.isArray(val)) {
632
+ key = key + '[]';
633
+ } else {
634
+ val = [val];
635
+ }
614
636
 
615
- /**
616
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
617
- * timeout is not created.
618
- */
619
- timeout: 0,
637
+ utils.forEach(val, function parseValue(v) {
638
+ if (utils.isDate(v)) {
639
+ v = v.toISOString();
640
+ } else if (utils.isObject(v)) {
641
+ v = JSON.stringify(v);
642
+ }
643
+ parts.push(encode(key) + '=' + encode(v));
644
+ });
645
+ });
620
646
 
621
- xsrfCookieName: 'XSRF-TOKEN',
622
- xsrfHeaderName: 'X-XSRF-TOKEN',
647
+ serializedParams = parts.join('&');
648
+ }
623
649
 
624
- maxContentLength: -1,
650
+ if (serializedParams) {
651
+ var hashmarkIndex = url.indexOf('#');
652
+ if (hashmarkIndex !== -1) {
653
+ url = url.slice(0, hashmarkIndex);
654
+ }
625
655
 
626
- validateStatus: function validateStatus(status) {
627
- return status >= 200 && status < 300;
656
+ url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
628
657
  }
629
- };
630
658
 
631
- defaults.headers = {
632
- common: {
633
- 'Accept': 'application/json, text/plain, */*'
634
- }
659
+ return url;
635
660
  };
636
-
637
- utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
638
- defaults.headers[method] = {};
639
- });
640
-
641
- utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
642
- defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
643
- });
644
-
645
- module.exports = defaults;
646
661
 
647
662
 
648
663
  /***/ }),
649
- /* 7 */
664
+ /* 6 */
650
665
  /***/ (function(module, exports, __webpack_require__) {
651
666
 
652
667
  'use strict';
653
668
 
654
669
  var utils = __webpack_require__(2);
655
670
 
656
- module.exports = function normalizeHeaderName(headers, normalizedName) {
657
- utils.forEach(headers, function processHeader(value, name) {
658
- if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
659
- headers[normalizedName] = value;
660
- delete headers[name];
671
+ function InterceptorManager() {
672
+ this.handlers = [];
673
+ }
674
+
675
+ /**
676
+ * Add a new interceptor to the stack
677
+ *
678
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
679
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
680
+ *
681
+ * @return {Number} An ID used to remove interceptor later
682
+ */
683
+ InterceptorManager.prototype.use = function use(fulfilled, rejected) {
684
+ this.handlers.push({
685
+ fulfilled: fulfilled,
686
+ rejected: rejected
687
+ });
688
+ return this.handlers.length - 1;
689
+ };
690
+
691
+ /**
692
+ * Remove an interceptor from the stack
693
+ *
694
+ * @param {Number} id The ID that was returned by `use`
695
+ */
696
+ InterceptorManager.prototype.eject = function eject(id) {
697
+ if (this.handlers[id]) {
698
+ this.handlers[id] = null;
699
+ }
700
+ };
701
+
702
+ /**
703
+ * Iterate over all the registered interceptors
704
+ *
705
+ * This method is particularly useful for skipping over any
706
+ * interceptors that may have become `null` calling `eject`.
707
+ *
708
+ * @param {Function} fn The function to call for each interceptor
709
+ */
710
+ InterceptorManager.prototype.forEach = function forEach(fn) {
711
+ utils.forEach(this.handlers, function forEachHandler(h) {
712
+ if (h !== null) {
713
+ fn(h);
661
714
  }
662
715
  });
663
716
  };
717
+
718
+ module.exports = InterceptorManager;
664
719
 
665
720
 
666
721
  /***/ }),
667
- /* 8 */
722
+ /* 7 */
668
723
  /***/ (function(module, exports, __webpack_require__) {
669
724
 
670
725
  'use strict';
671
726
 
672
727
  var utils = __webpack_require__(2);
673
- var settle = __webpack_require__(9);
674
- var buildURL = __webpack_require__(12);
675
- var parseHeaders = __webpack_require__(13);
676
- var isURLSameOrigin = __webpack_require__(14);
677
- var createError = __webpack_require__(10);
728
+ var transformData = __webpack_require__(8);
729
+ var isCancel = __webpack_require__(9);
730
+ var defaults = __webpack_require__(10);
678
731
 
679
- module.exports = function xhrAdapter(config) {
680
- return new Promise(function dispatchXhrRequest(resolve, reject) {
681
- var requestData = config.data;
682
- var requestHeaders = config.headers;
732
+ /**
733
+ * Throws a `Cancel` if cancellation has been requested.
734
+ */
735
+ function throwIfCancellationRequested(config) {
736
+ if (config.cancelToken) {
737
+ config.cancelToken.throwIfRequested();
738
+ }
739
+ }
683
740
 
684
- if (utils.isFormData(requestData)) {
741
+ /**
742
+ * Dispatch a request to the server using the configured adapter.
743
+ *
744
+ * @param {object} config The config that is to be used for the request
745
+ * @returns {Promise} The Promise to be fulfilled
746
+ */
747
+ module.exports = function dispatchRequest(config) {
748
+ throwIfCancellationRequested(config);
749
+
750
+ // Ensure headers exist
751
+ config.headers = config.headers || {};
752
+
753
+ // Transform request data
754
+ config.data = transformData(
755
+ config.data,
756
+ config.headers,
757
+ config.transformRequest
758
+ );
759
+
760
+ // Flatten headers
761
+ config.headers = utils.merge(
762
+ config.headers.common || {},
763
+ config.headers[config.method] || {},
764
+ config.headers
765
+ );
766
+
767
+ utils.forEach(
768
+ ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
769
+ function cleanHeaderConfig(method) {
770
+ delete config.headers[method];
771
+ }
772
+ );
773
+
774
+ var adapter = config.adapter || defaults.adapter;
775
+
776
+ return adapter(config).then(function onAdapterResolution(response) {
777
+ throwIfCancellationRequested(config);
778
+
779
+ // Transform response data
780
+ response.data = transformData(
781
+ response.data,
782
+ response.headers,
783
+ config.transformResponse
784
+ );
785
+
786
+ return response;
787
+ }, function onAdapterRejection(reason) {
788
+ if (!isCancel(reason)) {
789
+ throwIfCancellationRequested(config);
790
+
791
+ // Transform response data
792
+ if (reason && reason.response) {
793
+ reason.response.data = transformData(
794
+ reason.response.data,
795
+ reason.response.headers,
796
+ config.transformResponse
797
+ );
798
+ }
799
+ }
800
+
801
+ return Promise.reject(reason);
802
+ });
803
+ };
804
+
805
+
806
+ /***/ }),
807
+ /* 8 */
808
+ /***/ (function(module, exports, __webpack_require__) {
809
+
810
+ 'use strict';
811
+
812
+ var utils = __webpack_require__(2);
813
+
814
+ /**
815
+ * Transform the data for a request or a response
816
+ *
817
+ * @param {Object|String} data The data to be transformed
818
+ * @param {Array} headers The headers for the request or response
819
+ * @param {Array|Function} fns A single function or Array of functions
820
+ * @returns {*} The resulting transformed data
821
+ */
822
+ module.exports = function transformData(data, headers, fns) {
823
+ /*eslint no-param-reassign:0*/
824
+ utils.forEach(fns, function transform(fn) {
825
+ data = fn(data, headers);
826
+ });
827
+
828
+ return data;
829
+ };
830
+
831
+
832
+ /***/ }),
833
+ /* 9 */
834
+ /***/ (function(module, exports) {
835
+
836
+ 'use strict';
837
+
838
+ module.exports = function isCancel(value) {
839
+ return !!(value && value.__CANCEL__);
840
+ };
841
+
842
+
843
+ /***/ }),
844
+ /* 10 */
845
+ /***/ (function(module, exports, __webpack_require__) {
846
+
847
+ 'use strict';
848
+
849
+ var utils = __webpack_require__(2);
850
+ var normalizeHeaderName = __webpack_require__(11);
851
+
852
+ var DEFAULT_CONTENT_TYPE = {
853
+ 'Content-Type': 'application/x-www-form-urlencoded'
854
+ };
855
+
856
+ function setContentTypeIfUnset(headers, value) {
857
+ if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
858
+ headers['Content-Type'] = value;
859
+ }
860
+ }
861
+
862
+ function getDefaultAdapter() {
863
+ var adapter;
864
+ if (typeof XMLHttpRequest !== 'undefined') {
865
+ // For browsers use XHR adapter
866
+ adapter = __webpack_require__(12);
867
+ } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
868
+ // For node use HTTP adapter
869
+ adapter = __webpack_require__(12);
870
+ }
871
+ return adapter;
872
+ }
873
+
874
+ var defaults = {
875
+ adapter: getDefaultAdapter(),
876
+
877
+ transformRequest: [function transformRequest(data, headers) {
878
+ normalizeHeaderName(headers, 'Accept');
879
+ normalizeHeaderName(headers, 'Content-Type');
880
+ if (utils.isFormData(data) ||
881
+ utils.isArrayBuffer(data) ||
882
+ utils.isBuffer(data) ||
883
+ utils.isStream(data) ||
884
+ utils.isFile(data) ||
885
+ utils.isBlob(data)
886
+ ) {
887
+ return data;
888
+ }
889
+ if (utils.isArrayBufferView(data)) {
890
+ return data.buffer;
891
+ }
892
+ if (utils.isURLSearchParams(data)) {
893
+ setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
894
+ return data.toString();
895
+ }
896
+ if (utils.isObject(data)) {
897
+ setContentTypeIfUnset(headers, 'application/json;charset=utf-8');
898
+ return JSON.stringify(data);
899
+ }
900
+ return data;
901
+ }],
902
+
903
+ transformResponse: [function transformResponse(data) {
904
+ /*eslint no-param-reassign:0*/
905
+ if (typeof data === 'string') {
906
+ try {
907
+ data = JSON.parse(data);
908
+ } catch (e) { /* Ignore */ }
909
+ }
910
+ return data;
911
+ }],
912
+
913
+ /**
914
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
915
+ * timeout is not created.
916
+ */
917
+ timeout: 0,
918
+
919
+ xsrfCookieName: 'XSRF-TOKEN',
920
+ xsrfHeaderName: 'X-XSRF-TOKEN',
921
+
922
+ maxContentLength: -1,
923
+
924
+ validateStatus: function validateStatus(status) {
925
+ return status >= 200 && status < 300;
926
+ }
927
+ };
928
+
929
+ defaults.headers = {
930
+ common: {
931
+ 'Accept': 'application/json, text/plain, */*'
932
+ }
933
+ };
934
+
935
+ utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
936
+ defaults.headers[method] = {};
937
+ });
938
+
939
+ utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
940
+ defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
941
+ });
942
+
943
+ module.exports = defaults;
944
+
945
+
946
+ /***/ }),
947
+ /* 11 */
948
+ /***/ (function(module, exports, __webpack_require__) {
949
+
950
+ 'use strict';
951
+
952
+ var utils = __webpack_require__(2);
953
+
954
+ module.exports = function normalizeHeaderName(headers, normalizedName) {
955
+ utils.forEach(headers, function processHeader(value, name) {
956
+ if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
957
+ headers[normalizedName] = value;
958
+ delete headers[name];
959
+ }
960
+ });
961
+ };
962
+
963
+
964
+ /***/ }),
965
+ /* 12 */
966
+ /***/ (function(module, exports, __webpack_require__) {
967
+
968
+ 'use strict';
969
+
970
+ var utils = __webpack_require__(2);
971
+ var settle = __webpack_require__(13);
972
+ var buildURL = __webpack_require__(5);
973
+ var buildFullPath = __webpack_require__(16);
974
+ var parseHeaders = __webpack_require__(19);
975
+ var isURLSameOrigin = __webpack_require__(20);
976
+ var createError = __webpack_require__(14);
977
+
978
+ module.exports = function xhrAdapter(config) {
979
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
980
+ var requestData = config.data;
981
+ var requestHeaders = config.headers;
982
+
983
+ if (utils.isFormData(requestData)) {
685
984
  delete requestHeaders['Content-Type']; // Let the browser set it
686
985
  }
687
986
 
@@ -694,7 +993,8 @@ return /******/ (function(modules) { // webpackBootstrap
694
993
  requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
695
994
  }
696
995
 
697
- request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);
996
+ var fullPath = buildFullPath(config.baseURL, config.url);
997
+ request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
698
998
 
699
999
  // Set the request timeout in MS
700
1000
  request.timeout = config.timeout;
@@ -731,6 +1031,18 @@ return /******/ (function(modules) { // webpackBootstrap
731
1031
  request = null;
732
1032
  };
733
1033
 
1034
+ // Handle browser request cancellation (as opposed to a manual cancellation)
1035
+ request.onabort = function handleAbort() {
1036
+ if (!request) {
1037
+ return;
1038
+ }
1039
+
1040
+ reject(createError('Request aborted', config, 'ECONNABORTED', request));
1041
+
1042
+ // Clean up request
1043
+ request = null;
1044
+ };
1045
+
734
1046
  // Handle low level network errors
735
1047
  request.onerror = function handleError() {
736
1048
  // Real errors are hidden from us by the browser
@@ -743,7 +1055,11 @@ return /******/ (function(modules) { // webpackBootstrap
743
1055
 
744
1056
  // Handle timeout
745
1057
  request.ontimeout = function handleTimeout() {
746
- reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',
1058
+ var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';
1059
+ if (config.timeoutErrorMessage) {
1060
+ timeoutErrorMessage = config.timeoutErrorMessage;
1061
+ }
1062
+ reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',
747
1063
  request));
748
1064
 
749
1065
  // Clean up request
@@ -754,12 +1070,12 @@ return /******/ (function(modules) { // webpackBootstrap
754
1070
  // This is only done if running in a standard browser environment.
755
1071
  // Specifically not if we're in a web worker, or react-native.
756
1072
  if (utils.isStandardBrowserEnv()) {
757
- var cookies = __webpack_require__(15);
1073
+ var cookies = __webpack_require__(21);
758
1074
 
759
1075
  // Add xsrf header
760
- var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?
761
- cookies.read(config.xsrfCookieName) :
762
- undefined;
1076
+ var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
1077
+ cookies.read(config.xsrfCookieName) :
1078
+ undefined;
763
1079
 
764
1080
  if (xsrfValue) {
765
1081
  requestHeaders[config.xsrfHeaderName] = xsrfValue;
@@ -780,8 +1096,8 @@ return /******/ (function(modules) { // webpackBootstrap
780
1096
  }
781
1097
 
782
1098
  // Add withCredentials to request if needed
783
- if (config.withCredentials) {
784
- request.withCredentials = true;
1099
+ if (!utils.isUndefined(config.withCredentials)) {
1100
+ request.withCredentials = !!config.withCredentials;
785
1101
  }
786
1102
 
787
1103
  // Add responseType to request if needed
@@ -832,12 +1148,12 @@ return /******/ (function(modules) { // webpackBootstrap
832
1148
 
833
1149
 
834
1150
  /***/ }),
835
- /* 9 */
1151
+ /* 13 */
836
1152
  /***/ (function(module, exports, __webpack_require__) {
837
1153
 
838
1154
  'use strict';
839
1155
 
840
- var createError = __webpack_require__(10);
1156
+ var createError = __webpack_require__(14);
841
1157
 
842
1158
  /**
843
1159
  * Resolve or reject a Promise based on response status.
@@ -848,8 +1164,7 @@ return /******/ (function(modules) { // webpackBootstrap
848
1164
  */
849
1165
  module.exports = function settle(resolve, reject, response) {
850
1166
  var validateStatus = response.config.validateStatus;
851
- // Note: status is not exposed by XDomainRequest
852
- if (!response.status || !validateStatus || validateStatus(response.status)) {
1167
+ if (!validateStatus || validateStatus(response.status)) {
853
1168
  resolve(response);
854
1169
  } else {
855
1170
  reject(createError(
@@ -864,12 +1179,12 @@ return /******/ (function(modules) { // webpackBootstrap
864
1179
 
865
1180
 
866
1181
  /***/ }),
867
- /* 10 */
1182
+ /* 14 */
868
1183
  /***/ (function(module, exports, __webpack_require__) {
869
1184
 
870
1185
  'use strict';
871
1186
 
872
- var enhanceError = __webpack_require__(11);
1187
+ var enhanceError = __webpack_require__(15);
873
1188
 
874
1189
  /**
875
1190
  * Create an Error with the specified message, config, error code, request and response.
@@ -888,7 +1203,7 @@ return /******/ (function(modules) { // webpackBootstrap
888
1203
 
889
1204
 
890
1205
  /***/ }),
891
- /* 11 */
1206
+ /* 15 */
892
1207
  /***/ (function(module, exports) {
893
1208
 
894
1209
  'use strict';
@@ -908,86 +1223,101 @@ return /******/ (function(modules) { // webpackBootstrap
908
1223
  if (code) {
909
1224
  error.code = code;
910
1225
  }
1226
+
911
1227
  error.request = request;
912
1228
  error.response = response;
1229
+ error.isAxiosError = true;
1230
+
1231
+ error.toJSON = function() {
1232
+ return {
1233
+ // Standard
1234
+ message: this.message,
1235
+ name: this.name,
1236
+ // Microsoft
1237
+ description: this.description,
1238
+ number: this.number,
1239
+ // Mozilla
1240
+ fileName: this.fileName,
1241
+ lineNumber: this.lineNumber,
1242
+ columnNumber: this.columnNumber,
1243
+ stack: this.stack,
1244
+ // Axios
1245
+ config: this.config,
1246
+ code: this.code
1247
+ };
1248
+ };
913
1249
  return error;
914
1250
  };
915
1251
 
916
1252
 
917
1253
  /***/ }),
918
- /* 12 */
1254
+ /* 16 */
919
1255
  /***/ (function(module, exports, __webpack_require__) {
920
1256
 
921
1257
  'use strict';
922
1258
 
923
- var utils = __webpack_require__(2);
924
-
925
- function encode(val) {
926
- return encodeURIComponent(val).
927
- replace(/%40/gi, '@').
928
- replace(/%3A/gi, ':').
929
- replace(/%24/g, '$').
930
- replace(/%2C/gi, ',').
931
- replace(/%20/g, '+').
932
- replace(/%5B/gi, '[').
933
- replace(/%5D/gi, ']');
934
- }
1259
+ var isAbsoluteURL = __webpack_require__(17);
1260
+ var combineURLs = __webpack_require__(18);
935
1261
 
936
1262
  /**
937
- * Build a URL by appending params to the end
1263
+ * Creates a new URL by combining the baseURL with the requestedURL,
1264
+ * only when the requestedURL is not already an absolute URL.
1265
+ * If the requestURL is absolute, this function returns the requestedURL untouched.
938
1266
  *
939
- * @param {string} url The base of the url (e.g., http://www.google.com)
940
- * @param {object} [params] The params to be appended
941
- * @returns {string} The formatted url
1267
+ * @param {string} baseURL The base URL
1268
+ * @param {string} requestedURL Absolute or relative URL to combine
1269
+ * @returns {string} The combined full path
942
1270
  */
943
- module.exports = function buildURL(url, params, paramsSerializer) {
944
- /*eslint no-param-reassign:0*/
945
- if (!params) {
946
- return url;
947
- }
948
-
949
- var serializedParams;
950
- if (paramsSerializer) {
951
- serializedParams = paramsSerializer(params);
952
- } else if (utils.isURLSearchParams(params)) {
953
- serializedParams = params.toString();
954
- } else {
955
- var parts = [];
956
-
957
- utils.forEach(params, function serialize(val, key) {
958
- if (val === null || typeof val === 'undefined') {
959
- return;
960
- }
961
-
962
- if (utils.isArray(val)) {
963
- key = key + '[]';
964
- } else {
965
- val = [val];
966
- }
967
-
968
- utils.forEach(val, function parseValue(v) {
969
- if (utils.isDate(v)) {
970
- v = v.toISOString();
971
- } else if (utils.isObject(v)) {
972
- v = JSON.stringify(v);
973
- }
974
- parts.push(encode(key) + '=' + encode(v));
975
- });
976
- });
977
-
978
- serializedParams = parts.join('&');
1271
+ module.exports = function buildFullPath(baseURL, requestedURL) {
1272
+ if (baseURL && !isAbsoluteURL(requestedURL)) {
1273
+ return combineURLs(baseURL, requestedURL);
979
1274
  }
1275
+ return requestedURL;
1276
+ };
1277
+
1278
+
1279
+ /***/ }),
1280
+ /* 17 */
1281
+ /***/ (function(module, exports) {
1282
+
1283
+ 'use strict';
980
1284
 
981
- if (serializedParams) {
982
- url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
983
- }
1285
+ /**
1286
+ * Determines whether the specified URL is absolute
1287
+ *
1288
+ * @param {string} url The URL to test
1289
+ * @returns {boolean} True if the specified URL is absolute, otherwise false
1290
+ */
1291
+ module.exports = function isAbsoluteURL(url) {
1292
+ // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
1293
+ // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
1294
+ // by any combination of letters, digits, plus, period, or hyphen.
1295
+ return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
1296
+ };
1297
+
1298
+
1299
+ /***/ }),
1300
+ /* 18 */
1301
+ /***/ (function(module, exports) {
1302
+
1303
+ 'use strict';
984
1304
 
985
- return url;
1305
+ /**
1306
+ * Creates a new URL by combining the specified URLs
1307
+ *
1308
+ * @param {string} baseURL The base URL
1309
+ * @param {string} relativeURL The relative URL
1310
+ * @returns {string} The combined URL
1311
+ */
1312
+ module.exports = function combineURLs(baseURL, relativeURL) {
1313
+ return relativeURL
1314
+ ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
1315
+ : baseURL;
986
1316
  };
987
1317
 
988
1318
 
989
1319
  /***/ }),
990
- /* 13 */
1320
+ /* 19 */
991
1321
  /***/ (function(module, exports, __webpack_require__) {
992
1322
 
993
1323
  'use strict';
@@ -1046,7 +1376,7 @@ return /******/ (function(modules) { // webpackBootstrap
1046
1376
 
1047
1377
 
1048
1378
  /***/ }),
1049
- /* 14 */
1379
+ /* 20 */
1050
1380
  /***/ (function(module, exports, __webpack_require__) {
1051
1381
 
1052
1382
  'use strict';
@@ -1058,69 +1388,69 @@ return /******/ (function(modules) { // webpackBootstrap
1058
1388
 
1059
1389
  // Standard browser envs have full support of the APIs needed to test
1060
1390
  // whether the request URL is of the same origin as current location.
1061
- (function standardBrowserEnv() {
1062
- var msie = /(msie|trident)/i.test(navigator.userAgent);
1063
- var urlParsingNode = document.createElement('a');
1064
- var originURL;
1391
+ (function standardBrowserEnv() {
1392
+ var msie = /(msie|trident)/i.test(navigator.userAgent);
1393
+ var urlParsingNode = document.createElement('a');
1394
+ var originURL;
1065
1395
 
1066
- /**
1396
+ /**
1067
1397
  * Parse a URL to discover it's components
1068
1398
  *
1069
1399
  * @param {String} url The URL to be parsed
1070
1400
  * @returns {Object}
1071
1401
  */
1072
- function resolveURL(url) {
1073
- var href = url;
1402
+ function resolveURL(url) {
1403
+ var href = url;
1074
1404
 
1075
- if (msie) {
1405
+ if (msie) {
1076
1406
  // IE needs attribute set twice to normalize properties
1077
- urlParsingNode.setAttribute('href', href);
1078
- href = urlParsingNode.href;
1079
- }
1407
+ urlParsingNode.setAttribute('href', href);
1408
+ href = urlParsingNode.href;
1409
+ }
1080
1410
 
1081
- urlParsingNode.setAttribute('href', href);
1411
+ urlParsingNode.setAttribute('href', href);
1082
1412
 
1083
- // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
1084
- return {
1085
- href: urlParsingNode.href,
1086
- protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
1087
- host: urlParsingNode.host,
1088
- search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
1089
- hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
1090
- hostname: urlParsingNode.hostname,
1091
- port: urlParsingNode.port,
1092
- pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
1093
- urlParsingNode.pathname :
1094
- '/' + urlParsingNode.pathname
1095
- };
1096
- }
1413
+ // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
1414
+ return {
1415
+ href: urlParsingNode.href,
1416
+ protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
1417
+ host: urlParsingNode.host,
1418
+ search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
1419
+ hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
1420
+ hostname: urlParsingNode.hostname,
1421
+ port: urlParsingNode.port,
1422
+ pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
1423
+ urlParsingNode.pathname :
1424
+ '/' + urlParsingNode.pathname
1425
+ };
1426
+ }
1097
1427
 
1098
- originURL = resolveURL(window.location.href);
1428
+ originURL = resolveURL(window.location.href);
1099
1429
 
1100
- /**
1430
+ /**
1101
1431
  * Determine if a URL shares the same origin as the current location
1102
1432
  *
1103
1433
  * @param {String} requestURL The URL to test
1104
1434
  * @returns {boolean} True if URL shares the same origin, otherwise false
1105
1435
  */
1106
- return function isURLSameOrigin(requestURL) {
1107
- var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
1108
- return (parsed.protocol === originURL.protocol &&
1436
+ return function isURLSameOrigin(requestURL) {
1437
+ var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
1438
+ return (parsed.protocol === originURL.protocol &&
1109
1439
  parsed.host === originURL.host);
1110
- };
1111
- })() :
1440
+ };
1441
+ })() :
1112
1442
 
1113
1443
  // Non standard browser envs (web workers, react-native) lack needed support.
1114
- (function nonStandardBrowserEnv() {
1115
- return function isURLSameOrigin() {
1116
- return true;
1117
- };
1118
- })()
1444
+ (function nonStandardBrowserEnv() {
1445
+ return function isURLSameOrigin() {
1446
+ return true;
1447
+ };
1448
+ })()
1119
1449
  );
1120
1450
 
1121
1451
 
1122
1452
  /***/ }),
1123
- /* 15 */
1453
+ /* 21 */
1124
1454
  /***/ (function(module, exports, __webpack_require__) {
1125
1455
 
1126
1456
  'use strict';
@@ -1131,282 +1461,134 @@ return /******/ (function(modules) { // webpackBootstrap
1131
1461
  utils.isStandardBrowserEnv() ?
1132
1462
 
1133
1463
  // Standard browser envs support document.cookie
1134
- (function standardBrowserEnv() {
1135
- return {
1136
- write: function write(name, value, expires, path, domain, secure) {
1137
- var cookie = [];
1138
- cookie.push(name + '=' + encodeURIComponent(value));
1464
+ (function standardBrowserEnv() {
1465
+ return {
1466
+ write: function write(name, value, expires, path, domain, secure) {
1467
+ var cookie = [];
1468
+ cookie.push(name + '=' + encodeURIComponent(value));
1139
1469
 
1140
- if (utils.isNumber(expires)) {
1141
- cookie.push('expires=' + new Date(expires).toGMTString());
1142
- }
1470
+ if (utils.isNumber(expires)) {
1471
+ cookie.push('expires=' + new Date(expires).toGMTString());
1472
+ }
1143
1473
 
1144
- if (utils.isString(path)) {
1145
- cookie.push('path=' + path);
1146
- }
1474
+ if (utils.isString(path)) {
1475
+ cookie.push('path=' + path);
1476
+ }
1147
1477
 
1148
- if (utils.isString(domain)) {
1149
- cookie.push('domain=' + domain);
1150
- }
1478
+ if (utils.isString(domain)) {
1479
+ cookie.push('domain=' + domain);
1480
+ }
1151
1481
 
1152
- if (secure === true) {
1153
- cookie.push('secure');
1154
- }
1482
+ if (secure === true) {
1483
+ cookie.push('secure');
1484
+ }
1155
1485
 
1156
- document.cookie = cookie.join('; ');
1157
- },
1486
+ document.cookie = cookie.join('; ');
1487
+ },
1158
1488
 
1159
- read: function read(name) {
1160
- var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
1161
- return (match ? decodeURIComponent(match[3]) : null);
1162
- },
1489
+ read: function read(name) {
1490
+ var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
1491
+ return (match ? decodeURIComponent(match[3]) : null);
1492
+ },
1163
1493
 
1164
- remove: function remove(name) {
1165
- this.write(name, '', Date.now() - 86400000);
1166
- }
1167
- };
1168
- })() :
1494
+ remove: function remove(name) {
1495
+ this.write(name, '', Date.now() - 86400000);
1496
+ }
1497
+ };
1498
+ })() :
1169
1499
 
1170
1500
  // Non standard browser env (web workers, react-native) lack needed support.
1171
- (function nonStandardBrowserEnv() {
1172
- return {
1173
- write: function write() {},
1174
- read: function read() { return null; },
1175
- remove: function remove() {}
1176
- };
1177
- })()
1501
+ (function nonStandardBrowserEnv() {
1502
+ return {
1503
+ write: function write() {},
1504
+ read: function read() { return null; },
1505
+ remove: function remove() {}
1506
+ };
1507
+ })()
1178
1508
  );
1179
1509
 
1180
1510
 
1181
1511
  /***/ }),
1182
- /* 16 */
1512
+ /* 22 */
1183
1513
  /***/ (function(module, exports, __webpack_require__) {
1184
1514
 
1185
1515
  'use strict';
1186
1516
 
1187
1517
  var utils = __webpack_require__(2);
1188
1518
 
1189
- function InterceptorManager() {
1190
- this.handlers = [];
1191
- }
1192
-
1193
1519
  /**
1194
- * Add a new interceptor to the stack
1195
- *
1196
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
1197
- * @param {Function} rejected The function to handle `reject` for a `Promise`
1520
+ * Config-specific merge-function which creates a new config-object
1521
+ * by merging two configuration objects together.
1198
1522
  *
1199
- * @return {Number} An ID used to remove interceptor later
1523
+ * @param {Object} config1
1524
+ * @param {Object} config2
1525
+ * @returns {Object} New object resulting from merging config2 to config1
1200
1526
  */
1201
- InterceptorManager.prototype.use = function use(fulfilled, rejected) {
1202
- this.handlers.push({
1203
- fulfilled: fulfilled,
1204
- rejected: rejected
1527
+ module.exports = function mergeConfig(config1, config2) {
1528
+ // eslint-disable-next-line no-param-reassign
1529
+ config2 = config2 || {};
1530
+ var config = {};
1531
+
1532
+ var valueFromConfig2Keys = ['url', 'method', 'params', 'data'];
1533
+ var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy'];
1534
+ var defaultToConfig2Keys = [
1535
+ 'baseURL', 'url', 'transformRequest', 'transformResponse', 'paramsSerializer',
1536
+ 'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',
1537
+ 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress',
1538
+ 'maxContentLength', 'validateStatus', 'maxRedirects', 'httpAgent',
1539
+ 'httpsAgent', 'cancelToken', 'socketPath'
1540
+ ];
1541
+
1542
+ utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {
1543
+ if (typeof config2[prop] !== 'undefined') {
1544
+ config[prop] = config2[prop];
1545
+ }
1205
1546
  });
1206
- return this.handlers.length - 1;
1207
- };
1208
-
1209
- /**
1210
- * Remove an interceptor from the stack
1211
- *
1212
- * @param {Number} id The ID that was returned by `use`
1213
- */
1214
- InterceptorManager.prototype.eject = function eject(id) {
1215
- if (this.handlers[id]) {
1216
- this.handlers[id] = null;
1217
- }
1218
- };
1219
1547
 
1220
- /**
1221
- * Iterate over all the registered interceptors
1222
- *
1223
- * This method is particularly useful for skipping over any
1224
- * interceptors that may have become `null` calling `eject`.
1225
- *
1226
- * @param {Function} fn The function to call for each interceptor
1227
- */
1228
- InterceptorManager.prototype.forEach = function forEach(fn) {
1229
- utils.forEach(this.handlers, function forEachHandler(h) {
1230
- if (h !== null) {
1231
- fn(h);
1548
+ utils.forEach(mergeDeepPropertiesKeys, function mergeDeepProperties(prop) {
1549
+ if (utils.isObject(config2[prop])) {
1550
+ config[prop] = utils.deepMerge(config1[prop], config2[prop]);
1551
+ } else if (typeof config2[prop] !== 'undefined') {
1552
+ config[prop] = config2[prop];
1553
+ } else if (utils.isObject(config1[prop])) {
1554
+ config[prop] = utils.deepMerge(config1[prop]);
1555
+ } else if (typeof config1[prop] !== 'undefined') {
1556
+ config[prop] = config1[prop];
1232
1557
  }
1233
1558
  });
1234
- };
1235
-
1236
- module.exports = InterceptorManager;
1237
-
1238
-
1239
- /***/ }),
1240
- /* 17 */
1241
- /***/ (function(module, exports, __webpack_require__) {
1242
-
1243
- 'use strict';
1244
-
1245
- var utils = __webpack_require__(2);
1246
- var transformData = __webpack_require__(18);
1247
- var isCancel = __webpack_require__(19);
1248
- var defaults = __webpack_require__(6);
1249
- var isAbsoluteURL = __webpack_require__(20);
1250
- var combineURLs = __webpack_require__(21);
1251
-
1252
- /**
1253
- * Throws a `Cancel` if cancellation has been requested.
1254
- */
1255
- function throwIfCancellationRequested(config) {
1256
- if (config.cancelToken) {
1257
- config.cancelToken.throwIfRequested();
1258
- }
1259
- }
1260
-
1261
- /**
1262
- * Dispatch a request to the server using the configured adapter.
1263
- *
1264
- * @param {object} config The config that is to be used for the request
1265
- * @returns {Promise} The Promise to be fulfilled
1266
- */
1267
- module.exports = function dispatchRequest(config) {
1268
- throwIfCancellationRequested(config);
1269
-
1270
- // Support baseURL config
1271
- if (config.baseURL && !isAbsoluteURL(config.url)) {
1272
- config.url = combineURLs(config.baseURL, config.url);
1273
- }
1274
-
1275
- // Ensure headers exist
1276
- config.headers = config.headers || {};
1277
-
1278
- // Transform request data
1279
- config.data = transformData(
1280
- config.data,
1281
- config.headers,
1282
- config.transformRequest
1283
- );
1284
-
1285
- // Flatten headers
1286
- config.headers = utils.merge(
1287
- config.headers.common || {},
1288
- config.headers[config.method] || {},
1289
- config.headers || {}
1290
- );
1291
1559
 
1292
- utils.forEach(
1293
- ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
1294
- function cleanHeaderConfig(method) {
1295
- delete config.headers[method];
1560
+ utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {
1561
+ if (typeof config2[prop] !== 'undefined') {
1562
+ config[prop] = config2[prop];
1563
+ } else if (typeof config1[prop] !== 'undefined') {
1564
+ config[prop] = config1[prop];
1296
1565
  }
1297
- );
1298
-
1299
- var adapter = config.adapter || defaults.adapter;
1300
-
1301
- return adapter(config).then(function onAdapterResolution(response) {
1302
- throwIfCancellationRequested(config);
1566
+ });
1303
1567
 
1304
- // Transform response data
1305
- response.data = transformData(
1306
- response.data,
1307
- response.headers,
1308
- config.transformResponse
1309
- );
1568
+ var axiosKeys = valueFromConfig2Keys
1569
+ .concat(mergeDeepPropertiesKeys)
1570
+ .concat(defaultToConfig2Keys);
1310
1571
 
1311
- return response;
1312
- }, function onAdapterRejection(reason) {
1313
- if (!isCancel(reason)) {
1314
- throwIfCancellationRequested(config);
1572
+ var otherKeys = Object
1573
+ .keys(config2)
1574
+ .filter(function filterAxiosKeys(key) {
1575
+ return axiosKeys.indexOf(key) === -1;
1576
+ });
1315
1577
 
1316
- // Transform response data
1317
- if (reason && reason.response) {
1318
- reason.response.data = transformData(
1319
- reason.response.data,
1320
- reason.response.headers,
1321
- config.transformResponse
1322
- );
1323
- }
1578
+ utils.forEach(otherKeys, function otherKeysDefaultToConfig2(prop) {
1579
+ if (typeof config2[prop] !== 'undefined') {
1580
+ config[prop] = config2[prop];
1581
+ } else if (typeof config1[prop] !== 'undefined') {
1582
+ config[prop] = config1[prop];
1324
1583
  }
1325
-
1326
- return Promise.reject(reason);
1327
- });
1328
- };
1329
-
1330
-
1331
- /***/ }),
1332
- /* 18 */
1333
- /***/ (function(module, exports, __webpack_require__) {
1334
-
1335
- 'use strict';
1336
-
1337
- var utils = __webpack_require__(2);
1338
-
1339
- /**
1340
- * Transform the data for a request or a response
1341
- *
1342
- * @param {Object|String} data The data to be transformed
1343
- * @param {Array} headers The headers for the request or response
1344
- * @param {Array|Function} fns A single function or Array of functions
1345
- * @returns {*} The resulting transformed data
1346
- */
1347
- module.exports = function transformData(data, headers, fns) {
1348
- /*eslint no-param-reassign:0*/
1349
- utils.forEach(fns, function transform(fn) {
1350
- data = fn(data, headers);
1351
1584
  });
1352
1585
 
1353
- return data;
1354
- };
1355
-
1356
-
1357
- /***/ }),
1358
- /* 19 */
1359
- /***/ (function(module, exports) {
1360
-
1361
- 'use strict';
1362
-
1363
- module.exports = function isCancel(value) {
1364
- return !!(value && value.__CANCEL__);
1365
- };
1366
-
1367
-
1368
- /***/ }),
1369
- /* 20 */
1370
- /***/ (function(module, exports) {
1371
-
1372
- 'use strict';
1373
-
1374
- /**
1375
- * Determines whether the specified URL is absolute
1376
- *
1377
- * @param {string} url The URL to test
1378
- * @returns {boolean} True if the specified URL is absolute, otherwise false
1379
- */
1380
- module.exports = function isAbsoluteURL(url) {
1381
- // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
1382
- // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
1383
- // by any combination of letters, digits, plus, period, or hyphen.
1384
- return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
1385
- };
1386
-
1387
-
1388
- /***/ }),
1389
- /* 21 */
1390
- /***/ (function(module, exports) {
1391
-
1392
- 'use strict';
1393
-
1394
- /**
1395
- * Creates a new URL by combining the specified URLs
1396
- *
1397
- * @param {string} baseURL The base URL
1398
- * @param {string} relativeURL The relative URL
1399
- * @returns {string} The combined URL
1400
- */
1401
- module.exports = function combineURLs(baseURL, relativeURL) {
1402
- return relativeURL
1403
- ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
1404
- : baseURL;
1586
+ return config;
1405
1587
  };
1406
1588
 
1407
1589
 
1408
1590
  /***/ }),
1409
- /* 22 */
1591
+ /* 23 */
1410
1592
  /***/ (function(module, exports) {
1411
1593
 
1412
1594
  'use strict';
@@ -1431,12 +1613,12 @@ return /******/ (function(modules) { // webpackBootstrap
1431
1613
 
1432
1614
 
1433
1615
  /***/ }),
1434
- /* 23 */
1616
+ /* 24 */
1435
1617
  /***/ (function(module, exports, __webpack_require__) {
1436
1618
 
1437
1619
  'use strict';
1438
1620
 
1439
- var Cancel = __webpack_require__(22);
1621
+ var Cancel = __webpack_require__(23);
1440
1622
 
1441
1623
  /**
1442
1624
  * A `CancelToken` is an object that can be used to request cancellation of an operation.
@@ -1494,7 +1676,7 @@ return /******/ (function(modules) { // webpackBootstrap
1494
1676
 
1495
1677
 
1496
1678
  /***/ }),
1497
- /* 24 */
1679
+ /* 25 */
1498
1680
  /***/ (function(module, exports) {
1499
1681
 
1500
1682
  'use strict';