Changeset 0c6b92a for imaps-frontend/node_modules/axios/dist/esm/axios.js
Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/axios/dist/esm/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 bind(fn, thisArg) { 3 3 return function wrap() { … … 1151 1151 * @param {string} url The base of the url (e.g., http://www.google.com) 1152 1152 * @param {object} [params] The params to be appended 1153 * @param {? object} options1153 * @param {?(object|Function)} options 1154 1154 * 1155 1155 * @returns {string} The formatted url … … 1162 1162 1163 1163 const _encode = options && options.encode || encode; 1164 1165 if (utils$1.isFunction(options)) { 1166 options = { 1167 serialize: options 1168 }; 1169 } 1164 1170 1165 1171 const serializeFn = options && options.serialize; … … 2151 2157 const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args)); 2152 2158 2153 const isURLSameOrigin = platform.hasStandardBrowserEnv ? 2154 2155 // Standard browser envs have full support of the APIs needed to test 2156 // whether the request URL is of the same origin as current location. 2157 (function standardBrowserEnv() { 2158 const msie = platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent); 2159 const urlParsingNode = document.createElement('a'); 2160 let originURL; 2161 2162 /** 2163 * Parse a URL to discover its components 2164 * 2165 * @param {String} url The URL to be parsed 2166 * @returns {Object} 2167 */ 2168 function resolveURL(url) { 2169 let href = url; 2170 2171 if (msie) { 2172 // IE needs attribute set twice to normalize properties 2173 urlParsingNode.setAttribute('href', href); 2174 href = urlParsingNode.href; 2175 } 2176 2177 urlParsingNode.setAttribute('href', href); 2178 2179 // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils 2180 return { 2181 href: urlParsingNode.href, 2182 protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', 2183 host: urlParsingNode.host, 2184 search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', 2185 hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', 2186 hostname: urlParsingNode.hostname, 2187 port: urlParsingNode.port, 2188 pathname: (urlParsingNode.pathname.charAt(0) === '/') ? 2189 urlParsingNode.pathname : 2190 '/' + urlParsingNode.pathname 2191 }; 2192 } 2193 2194 originURL = resolveURL(window.location.href); 2195 2196 /** 2197 * Determine if a URL shares the same origin as the current location 2198 * 2199 * @param {String} requestURL The URL to test 2200 * @returns {boolean} True if URL shares the same origin, otherwise false 2201 */ 2202 return function isURLSameOrigin(requestURL) { 2203 const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL; 2204 return (parsed.protocol === originURL.protocol && 2205 parsed.host === originURL.host); 2206 }; 2207 })() : 2208 2209 // Non standard browser envs (web workers, react-native) lack needed support. 2210 (function nonStandardBrowserEnv() { 2211 return function isURLSameOrigin() { 2212 return true; 2213 }; 2214 })(); 2159 const isURLSameOrigin = platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => { 2160 url = new URL(url, platform.origin); 2161 2162 return ( 2163 origin.protocol === url.protocol && 2164 origin.host === url.host && 2165 (isMSIE || origin.port === url.port) 2166 ); 2167 })( 2168 new URL(platform.origin), 2169 platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent) 2170 ) : () => true; 2215 2171 2216 2172 const cookies = platform.hasStandardBrowserEnv ? … … 2314 2270 const config = {}; 2315 2271 2316 function getMergedValue(target, source, caseless) {2272 function getMergedValue(target, source, prop, caseless) { 2317 2273 if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) { 2318 2274 return utils$1.merge.call({caseless}, target, source); … … 2326 2282 2327 2283 // eslint-disable-next-line consistent-return 2328 function mergeDeepProperties(a, b, caseless) {2284 function mergeDeepProperties(a, b, prop , caseless) { 2329 2285 if (!utils$1.isUndefined(b)) { 2330 return getMergedValue(a, b, caseless);2286 return getMergedValue(a, b, prop , caseless); 2331 2287 } else if (!utils$1.isUndefined(a)) { 2332 return getMergedValue(undefined, a, caseless);2288 return getMergedValue(undefined, a, prop , caseless); 2333 2289 } 2334 2290 } … … 2388 2344 responseEncoding: defaultToConfig2, 2389 2345 validateStatus: mergeDirectKeys, 2390 headers: (a, b ) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)2346 headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true) 2391 2347 }; 2392 2348 … … 3132 3088 } 3133 3089 3134 const VERSION$1 = "1.7. 7";3090 const VERSION$1 = "1.7.8"; 3135 3091 3136 3092 const validators$1 = {}; … … 3181 3137 return validator ? validator(value, opt, opts) : true; 3182 3138 }; 3139 }; 3140 3141 validators$1.spelling = function spelling(correctSpelling) { 3142 return (value, opt) => { 3143 // eslint-disable-next-line no-console 3144 console.warn(`${opt} is likely a misspelling of ${correctSpelling}`); 3145 return true; 3146 } 3183 3147 }; 3184 3148 … … 3252 3216 } catch (err) { 3253 3217 if (err instanceof Error) { 3254 let dummy ;3255 3256 Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());3218 let dummy = {}; 3219 3220 Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error()); 3257 3221 3258 3222 // slice off the Error: ... line … … 3308 3272 } 3309 3273 } 3274 3275 validator.assertOptions(config, { 3276 baseUrl: validators.spelling('baseURL'), 3277 withXsrfToken: validators.spelling('withXSRFToken') 3278 }, true); 3310 3279 3311 3280 // Set config.method
Note:
See TracChangeset
for help on using the changeset viewer.