Changeset 0c6b92a for imaps-frontend/node_modules/axios/dist/axios.js
- Timestamp:
- 12/12/24 17:06:06 (5 weeks ago)
- Branches:
- main
- Parents:
- d565449
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/axios/dist/axios.js
rd565449 r0c6b92a 1 // Axios v1.7. 7Copyright (c) 2024 Matt Zabriskie and contributors1 // Axios v1.7.8 Copyright (c) 2024 Matt Zabriskie and contributors 2 2 (function (global, factory) { 3 3 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : … … 1736 1736 * @param {string} url The base of the url (e.g., http://www.google.com) 1737 1737 * @param {object} [params] The params to be appended 1738 * @param {? object} options1738 * @param {?(object|Function)} options 1739 1739 * 1740 1740 * @returns {string} The formatted url … … 1746 1746 } 1747 1747 var _encode = options && options.encode || encode; 1748 if (utils$1.isFunction(options)) { 1749 options = { 1750 serialize: options 1751 }; 1752 } 1748 1753 var serializeFn = options && options.serialize; 1749 1754 var serializedParams; … … 2643 2648 }; 2644 2649 2645 var isURLSameOrigin = platform.hasStandardBrowserEnv ? 2646 // Standard browser envs have full support of the APIs needed to test 2647 // whether the request URL is of the same origin as current location. 2648 function standardBrowserEnv() { 2649 var msie = platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent); 2650 var urlParsingNode = document.createElement('a'); 2651 var originURL; 2652 2653 /** 2654 * Parse a URL to discover its components 2655 * 2656 * @param {String} url The URL to be parsed 2657 * @returns {Object} 2658 */ 2659 function resolveURL(url) { 2660 var href = url; 2661 if (msie) { 2662 // IE needs attribute set twice to normalize properties 2663 urlParsingNode.setAttribute('href', href); 2664 href = urlParsingNode.href; 2665 } 2666 urlParsingNode.setAttribute('href', href); 2667 2668 // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils 2669 return { 2670 href: urlParsingNode.href, 2671 protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', 2672 host: urlParsingNode.host, 2673 search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', 2674 hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', 2675 hostname: urlParsingNode.hostname, 2676 port: urlParsingNode.port, 2677 pathname: urlParsingNode.pathname.charAt(0) === '/' ? urlParsingNode.pathname : '/' + urlParsingNode.pathname 2678 }; 2679 } 2680 originURL = resolveURL(window.location.href); 2681 2682 /** 2683 * Determine if a URL shares the same origin as the current location 2684 * 2685 * @param {String} requestURL The URL to test 2686 * @returns {boolean} True if URL shares the same origin, otherwise false 2687 */ 2688 return function isURLSameOrigin(requestURL) { 2689 var parsed = utils$1.isString(requestURL) ? resolveURL(requestURL) : requestURL; 2690 return parsed.protocol === originURL.protocol && parsed.host === originURL.host; 2650 var isURLSameOrigin = platform.hasStandardBrowserEnv ? function (origin, isMSIE) { 2651 return function (url) { 2652 url = new URL(url, platform.origin); 2653 return origin.protocol === url.protocol && origin.host === url.host && (isMSIE || origin.port === url.port); 2691 2654 }; 2692 }() : 2693 // Non standard browser envs (web workers, react-native) lack needed support. 2694 function nonStandardBrowserEnv() { 2695 return function isURLSameOrigin() { 2696 return true; 2697 }; 2698 }(); 2655 }(new URL(platform.origin), platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)) : function () { 2656 return true; 2657 }; 2699 2658 2700 2659 var cookies = platform.hasStandardBrowserEnv ? … … 2786 2745 config2 = config2 || {}; 2787 2746 var config = {}; 2788 function getMergedValue(target, source, caseless) {2747 function getMergedValue(target, source, prop, caseless) { 2789 2748 if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) { 2790 2749 return utils$1.merge.call({ … … 2800 2759 2801 2760 // eslint-disable-next-line consistent-return 2802 function mergeDeepProperties(a, b, caseless) {2761 function mergeDeepProperties(a, b, prop, caseless) { 2803 2762 if (!utils$1.isUndefined(b)) { 2804 return getMergedValue(a, b, caseless);2763 return getMergedValue(a, b, prop, caseless); 2805 2764 } else if (!utils$1.isUndefined(a)) { 2806 return getMergedValue(undefined, a, caseless);2765 return getMergedValue(undefined, a, prop, caseless); 2807 2766 } 2808 2767 } … … 2861 2820 responseEncoding: defaultToConfig2, 2862 2821 validateStatus: mergeDirectKeys, 2863 headers: function headers(a, b ) {2864 return mergeDeepProperties(headersToObject(a), headersToObject(b), true);2822 headers: function headers(a, b, prop) { 2823 return mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true); 2865 2824 } 2866 2825 }; … … 3718 3677 } 3719 3678 3720 var VERSION = "1.7. 7";3679 var VERSION = "1.7.8"; 3721 3680 3722 3681 var validators$1 = {}; … … 3755 3714 } 3756 3715 return validator ? validator(value, opt, opts) : true; 3716 }; 3717 }; 3718 validators$1.spelling = function spelling(correctSpelling) { 3719 return function (value, opt) { 3720 // eslint-disable-next-line no-console 3721 console.warn("".concat(opt, " is likely a misspelling of ").concat(correctSpelling)); 3722 return true; 3757 3723 }; 3758 3724 }; … … 3839 3805 _context.t0 = _context["catch"](0); 3840 3806 if (_context.t0 instanceof Error) { 3841 Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : dummy = new Error(); 3807 dummy = {}; 3808 Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error(); 3842 3809 3843 3810 // slice off the Error: ... line … … 3901 3868 } 3902 3869 } 3870 validator.assertOptions(config, { 3871 baseUrl: validators.spelling('baseURL'), 3872 withXsrfToken: validators.spelling('withXSRFToken') 3873 }, true); 3903 3874 3904 3875 // Set config.method
Note:
See TracChangeset
for help on using the changeset viewer.