2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-23 20:40:40 +03:00

chore: build new version

This commit is contained in:
Jay
2022-12-29 08:21:12 +02:00
parent 6f74cb1880
commit 45c4948416
15 changed files with 351 additions and 27 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "axios", "name": "axios",
"main": "./dist/axios.js", "main": "./dist/axios.js",
"version": "1.2.1", "version": "1.2.2",
"homepage": "https://axios-http.com", "homepage": "https://axios-http.com",
"authors": [ "authors": [
"Matt Zabriskie" "Matt Zabriskie"
+84 -4
View File
@@ -1,4 +1,4 @@
// Axios v1.2.1 Copyright (c) 2022 Matt Zabriskie and contributors // Axios v1.2.2 Copyright (c) 2022 Matt Zabriskie and contributors
(function (global, factory) { (function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) : typeof define === 'function' && define.amd ? define(factory) :
@@ -367,7 +367,11 @@
} }
return null; return null;
} }
var _global = typeof self === "undefined" ? typeof global === "undefined" ? undefined : global : self; var _global = function () {
/*eslint no-undef:0*/
if (typeof globalThis !== "undefined") return globalThis;
return typeof self !== "undefined" ? self : typeof window !== 'undefined' ? window : global;
}();
var isContextDefined = function isContextDefined(context) { var isContextDefined = function isContextDefined(context) {
return !isUndefined(context) && context !== _global; return !isUndefined(context) && context !== _global;
}; };
@@ -1223,7 +1227,9 @@
* This leads to a problem when axios post `FormData` in webWorker * This leads to a problem when axios post `FormData` in webWorker
*/ */
var isStandardBrowserWebWorkerEnv = function () { var isStandardBrowserWebWorkerEnv = function () {
return typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope && typeof self.importScripts === 'function'; return typeof WorkerGlobalScope !== 'undefined' &&
// eslint-disable-next-line no-undef
self instanceof WorkerGlobalScope && typeof self.importScripts === 'function';
}(); }();
var platform = { var platform = {
isBrowser: true, isBrowser: true,
@@ -2391,7 +2397,7 @@
return config; return config;
} }
var VERSION = "1.2.1"; var VERSION = "1.2.2";
var validators$1 = {}; var validators$1 = {};
@@ -2783,6 +2789,79 @@
return utils.isObject(payload) && payload.isAxiosError === true; return utils.isObject(payload) && payload.isAxiosError === true;
} }
var HttpStatusCode = {
Continue: 100,
SwitchingProtocols: 101,
Processing: 102,
EarlyHints: 103,
Ok: 200,
Created: 201,
Accepted: 202,
NonAuthoritativeInformation: 203,
NoContent: 204,
ResetContent: 205,
PartialContent: 206,
MultiStatus: 207,
AlreadyReported: 208,
ImUsed: 226,
MultipleChoices: 300,
MovedPermanently: 301,
Found: 302,
SeeOther: 303,
NotModified: 304,
UseProxy: 305,
Unused: 306,
TemporaryRedirect: 307,
PermanentRedirect: 308,
BadRequest: 400,
Unauthorized: 401,
PaymentRequired: 402,
Forbidden: 403,
NotFound: 404,
MethodNotAllowed: 405,
NotAcceptable: 406,
ProxyAuthenticationRequired: 407,
RequestTimeout: 408,
Conflict: 409,
Gone: 410,
LengthRequired: 411,
PreconditionFailed: 412,
PayloadTooLarge: 413,
UriTooLong: 414,
UnsupportedMediaType: 415,
RangeNotSatisfiable: 416,
ExpectationFailed: 417,
ImATeapot: 418,
MisdirectedRequest: 421,
UnprocessableEntity: 422,
Locked: 423,
FailedDependency: 424,
TooEarly: 425,
UpgradeRequired: 426,
PreconditionRequired: 428,
TooManyRequests: 429,
RequestHeaderFieldsTooLarge: 431,
UnavailableForLegalReasons: 451,
InternalServerError: 500,
NotImplemented: 501,
BadGateway: 502,
ServiceUnavailable: 503,
GatewayTimeout: 504,
HttpVersionNotSupported: 505,
VariantAlsoNegotiates: 506,
InsufficientStorage: 507,
LoopDetected: 508,
NotExtended: 510,
NetworkAuthenticationRequired: 511
};
Object.entries(HttpStatusCode).forEach(function (_ref) {
var _ref2 = _slicedToArray(_ref, 2),
key = _ref2[0],
value = _ref2[1];
HttpStatusCode[value] = key;
});
var HttpStatusCode$1 = HttpStatusCode;
/** /**
* Create an instance of Axios * Create an instance of Axios
* *
@@ -2845,6 +2924,7 @@
axios.formToJSON = function (thing) { axios.formToJSON = function (thing) {
return formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing); return formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
}; };
axios.HttpStatusCode = HttpStatusCode$1;
axios["default"] = axios; axios["default"] = axios;
return axios; return axios;
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+82 -3
View File
@@ -1,4 +1,4 @@
// Axios v1.2.1 Copyright (c) 2022 Matt Zabriskie and contributors // Axios v1.2.2 Copyright (c) 2022 Matt Zabriskie and contributors
'use strict'; 'use strict';
function bind(fn, thisArg) { function bind(fn, thisArg) {
@@ -282,7 +282,11 @@ function findKey(obj, key) {
return null; return null;
} }
const _global = typeof self === "undefined" ? typeof global === "undefined" ? undefined : global : self; const _global = (() => {
/*eslint no-undef:0*/
if (typeof globalThis !== "undefined") return globalThis;
return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global)
})();
const isContextDefined = (context) => !isUndefined(context) && context !== _global; const isContextDefined = (context) => !isUndefined(context) && context !== _global;
@@ -1231,6 +1235,7 @@ const isStandardBrowserEnv = (() => {
const isStandardBrowserWebWorkerEnv = (() => { const isStandardBrowserWebWorkerEnv = (() => {
return ( return (
typeof WorkerGlobalScope !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&
// eslint-disable-next-line no-undef
self instanceof WorkerGlobalScope && self instanceof WorkerGlobalScope &&
typeof self.importScripts === 'function' typeof self.importScripts === 'function'
); );
@@ -2577,7 +2582,7 @@ function mergeConfig(config1, config2) {
return config; return config;
} }
const VERSION = "1.2.1"; const VERSION = "1.2.2";
const validators$1 = {}; const validators$1 = {};
@@ -3009,6 +3014,78 @@ function isAxiosError(payload) {
return utils.isObject(payload) && (payload.isAxiosError === true); return utils.isObject(payload) && (payload.isAxiosError === true);
} }
const HttpStatusCode = {
Continue: 100,
SwitchingProtocols: 101,
Processing: 102,
EarlyHints: 103,
Ok: 200,
Created: 201,
Accepted: 202,
NonAuthoritativeInformation: 203,
NoContent: 204,
ResetContent: 205,
PartialContent: 206,
MultiStatus: 207,
AlreadyReported: 208,
ImUsed: 226,
MultipleChoices: 300,
MovedPermanently: 301,
Found: 302,
SeeOther: 303,
NotModified: 304,
UseProxy: 305,
Unused: 306,
TemporaryRedirect: 307,
PermanentRedirect: 308,
BadRequest: 400,
Unauthorized: 401,
PaymentRequired: 402,
Forbidden: 403,
NotFound: 404,
MethodNotAllowed: 405,
NotAcceptable: 406,
ProxyAuthenticationRequired: 407,
RequestTimeout: 408,
Conflict: 409,
Gone: 410,
LengthRequired: 411,
PreconditionFailed: 412,
PayloadTooLarge: 413,
UriTooLong: 414,
UnsupportedMediaType: 415,
RangeNotSatisfiable: 416,
ExpectationFailed: 417,
ImATeapot: 418,
MisdirectedRequest: 421,
UnprocessableEntity: 422,
Locked: 423,
FailedDependency: 424,
TooEarly: 425,
UpgradeRequired: 426,
PreconditionRequired: 428,
TooManyRequests: 429,
RequestHeaderFieldsTooLarge: 431,
UnavailableForLegalReasons: 451,
InternalServerError: 500,
NotImplemented: 501,
BadGateway: 502,
ServiceUnavailable: 503,
GatewayTimeout: 504,
HttpVersionNotSupported: 505,
VariantAlsoNegotiates: 506,
InsufficientStorage: 507,
LoopDetected: 508,
NotExtended: 510,
NetworkAuthenticationRequired: 511,
};
Object.entries(HttpStatusCode).forEach(([key, value]) => {
HttpStatusCode[value] = key;
});
var HttpStatusCode$1 = HttpStatusCode;
/** /**
* Create an instance of Axios * Create an instance of Axios
* *
@@ -3070,6 +3147,8 @@ axios.AxiosHeaders = AxiosHeaders$1;
axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing); axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
axios.HttpStatusCode = HttpStatusCode$1;
axios.default = axios; axios.default = axios;
module.exports = axios; module.exports = axios;
+1 -1
View File
File diff suppressed because one or more lines are too long
+84 -4
View File
@@ -1,4 +1,4 @@
// Axios v1.2.1 Copyright (c) 2022 Matt Zabriskie and contributors // Axios v1.2.2 Copyright (c) 2022 Matt Zabriskie and contributors
function bind(fn, thisArg) { function bind(fn, thisArg) {
return function wrap() { return function wrap() {
return fn.apply(thisArg, arguments); return fn.apply(thisArg, arguments);
@@ -280,7 +280,11 @@ function findKey(obj, key) {
return null; return null;
} }
const _global = typeof self === "undefined" ? typeof global === "undefined" ? undefined : global : self; const _global = (() => {
/*eslint no-undef:0*/
if (typeof globalThis !== "undefined") return globalThis;
return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global)
})();
const isContextDefined = (context) => !isUndefined(context) && context !== _global; const isContextDefined = (context) => !isUndefined(context) && context !== _global;
@@ -1229,6 +1233,7 @@ const isStandardBrowserEnv = (() => {
const isStandardBrowserWebWorkerEnv = (() => { const isStandardBrowserWebWorkerEnv = (() => {
return ( return (
typeof WorkerGlobalScope !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&
// eslint-disable-next-line no-undef
self instanceof WorkerGlobalScope && self instanceof WorkerGlobalScope &&
typeof self.importScripts === 'function' typeof self.importScripts === 'function'
); );
@@ -2575,7 +2580,7 @@ function mergeConfig$1(config1, config2) {
return config; return config;
} }
const VERSION$1 = "1.2.1"; const VERSION$1 = "1.2.2";
const validators$1 = {}; const validators$1 = {};
@@ -3007,6 +3012,78 @@ function isAxiosError$1(payload) {
return utils.isObject(payload) && (payload.isAxiosError === true); return utils.isObject(payload) && (payload.isAxiosError === true);
} }
const HttpStatusCode$1 = {
Continue: 100,
SwitchingProtocols: 101,
Processing: 102,
EarlyHints: 103,
Ok: 200,
Created: 201,
Accepted: 202,
NonAuthoritativeInformation: 203,
NoContent: 204,
ResetContent: 205,
PartialContent: 206,
MultiStatus: 207,
AlreadyReported: 208,
ImUsed: 226,
MultipleChoices: 300,
MovedPermanently: 301,
Found: 302,
SeeOther: 303,
NotModified: 304,
UseProxy: 305,
Unused: 306,
TemporaryRedirect: 307,
PermanentRedirect: 308,
BadRequest: 400,
Unauthorized: 401,
PaymentRequired: 402,
Forbidden: 403,
NotFound: 404,
MethodNotAllowed: 405,
NotAcceptable: 406,
ProxyAuthenticationRequired: 407,
RequestTimeout: 408,
Conflict: 409,
Gone: 410,
LengthRequired: 411,
PreconditionFailed: 412,
PayloadTooLarge: 413,
UriTooLong: 414,
UnsupportedMediaType: 415,
RangeNotSatisfiable: 416,
ExpectationFailed: 417,
ImATeapot: 418,
MisdirectedRequest: 421,
UnprocessableEntity: 422,
Locked: 423,
FailedDependency: 424,
TooEarly: 425,
UpgradeRequired: 426,
PreconditionRequired: 428,
TooManyRequests: 429,
RequestHeaderFieldsTooLarge: 431,
UnavailableForLegalReasons: 451,
InternalServerError: 500,
NotImplemented: 501,
BadGateway: 502,
ServiceUnavailable: 503,
GatewayTimeout: 504,
HttpVersionNotSupported: 505,
VariantAlsoNegotiates: 506,
InsufficientStorage: 507,
LoopDetected: 508,
NotExtended: 510,
NetworkAuthenticationRequired: 511,
};
Object.entries(HttpStatusCode$1).forEach(([key, value]) => {
HttpStatusCode$1[value] = key;
});
const HttpStatusCode$2 = HttpStatusCode$1;
/** /**
* Create an instance of Axios * Create an instance of Axios
* *
@@ -3068,6 +3145,8 @@ axios.AxiosHeaders = AxiosHeaders$2;
axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing); axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
axios.HttpStatusCode = HttpStatusCode$2;
axios.default = axios; axios.default = axios;
// this module should only have a default export // this module should only have a default export
@@ -3089,9 +3168,10 @@ const {
spread, spread,
toFormData, toFormData,
AxiosHeaders, AxiosHeaders,
HttpStatusCode,
formToJSON, formToJSON,
mergeConfig mergeConfig
} = axios$1; } = axios$1;
export { Axios, AxiosError, AxiosHeaders, Cancel, CancelToken, CanceledError, VERSION, all, axios$1 as default, formToJSON, isAxiosError, isCancel, mergeConfig, spread, toFormData }; export { Axios, AxiosError, AxiosHeaders, Cancel, CancelToken, CanceledError, HttpStatusCode, VERSION, all, axios$1 as default, formToJSON, isAxiosError, isCancel, mergeConfig, spread, toFormData };
//# sourceMappingURL=axios.js.map //# sourceMappingURL=axios.js.map
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+89 -4
View File
@@ -1,4 +1,4 @@
// Axios v1.2.1 Copyright (c) 2022 Matt Zabriskie and contributors // Axios v1.2.2 Copyright (c) 2022 Matt Zabriskie and contributors
'use strict'; 'use strict';
const FormData$1 = require('form-data'); const FormData$1 = require('form-data');
@@ -303,7 +303,11 @@ function findKey(obj, key) {
return null; return null;
} }
const _global = typeof self === "undefined" ? typeof global === "undefined" ? undefined : global : self; const _global = (() => {
/*eslint no-undef:0*/
if (typeof globalThis !== "undefined") return globalThis;
return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global)
})();
const isContextDefined = (context) => !isUndefined(context) && context !== _global; const isContextDefined = (context) => !isUndefined(context) && context !== _global;
@@ -1907,7 +1911,7 @@ function buildFullPath(baseURL, requestedURL) {
return requestedURL; return requestedURL;
} }
const VERSION = "1.2.1"; const VERSION = "1.2.2";
function parseProtocol(url) { function parseProtocol(url) {
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
@@ -2234,6 +2238,11 @@ const zlibOptions = {
finishFlush: zlib__default["default"].constants.Z_SYNC_FLUSH finishFlush: zlib__default["default"].constants.Z_SYNC_FLUSH
}; };
const brotliOptions = {
flush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH,
finishFlush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH
};
const isBrotliSupported = utils.isFunction(zlib__default["default"].createBrotliDecompress); const isBrotliSupported = utils.isFunction(zlib__default["default"].createBrotliDecompress);
const {http: httpFollow, https: httpsFollow} = followRedirects__default["default"]; const {http: httpFollow, https: httpsFollow} = followRedirects__default["default"];
@@ -2624,7 +2633,9 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
switch (res.headers['content-encoding']) { switch (res.headers['content-encoding']) {
/*eslint default-case:0*/ /*eslint default-case:0*/
case 'gzip': case 'gzip':
case 'x-gzip':
case 'compress': case 'compress':
case 'x-compress':
case 'deflate': case 'deflate':
// add the unzipper to the body stream processing pipeline // add the unzipper to the body stream processing pipeline
streams.push(zlib__default["default"].createUnzip(zlibOptions)); streams.push(zlib__default["default"].createUnzip(zlibOptions));
@@ -2634,7 +2645,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
break; break;
case 'br': case 'br':
if (isBrotliSupported) { if (isBrotliSupported) {
streams.push(zlib__default["default"].createBrotliDecompress(zlibOptions)); streams.push(zlib__default["default"].createBrotliDecompress(brotliOptions));
delete res.headers['content-encoding']; delete res.headers['content-encoding'];
} }
} }
@@ -3809,6 +3820,78 @@ function isAxiosError(payload) {
return utils.isObject(payload) && (payload.isAxiosError === true); return utils.isObject(payload) && (payload.isAxiosError === true);
} }
const HttpStatusCode = {
Continue: 100,
SwitchingProtocols: 101,
Processing: 102,
EarlyHints: 103,
Ok: 200,
Created: 201,
Accepted: 202,
NonAuthoritativeInformation: 203,
NoContent: 204,
ResetContent: 205,
PartialContent: 206,
MultiStatus: 207,
AlreadyReported: 208,
ImUsed: 226,
MultipleChoices: 300,
MovedPermanently: 301,
Found: 302,
SeeOther: 303,
NotModified: 304,
UseProxy: 305,
Unused: 306,
TemporaryRedirect: 307,
PermanentRedirect: 308,
BadRequest: 400,
Unauthorized: 401,
PaymentRequired: 402,
Forbidden: 403,
NotFound: 404,
MethodNotAllowed: 405,
NotAcceptable: 406,
ProxyAuthenticationRequired: 407,
RequestTimeout: 408,
Conflict: 409,
Gone: 410,
LengthRequired: 411,
PreconditionFailed: 412,
PayloadTooLarge: 413,
UriTooLong: 414,
UnsupportedMediaType: 415,
RangeNotSatisfiable: 416,
ExpectationFailed: 417,
ImATeapot: 418,
MisdirectedRequest: 421,
UnprocessableEntity: 422,
Locked: 423,
FailedDependency: 424,
TooEarly: 425,
UpgradeRequired: 426,
PreconditionRequired: 428,
TooManyRequests: 429,
RequestHeaderFieldsTooLarge: 431,
UnavailableForLegalReasons: 451,
InternalServerError: 500,
NotImplemented: 501,
BadGateway: 502,
ServiceUnavailable: 503,
GatewayTimeout: 504,
HttpVersionNotSupported: 505,
VariantAlsoNegotiates: 506,
InsufficientStorage: 507,
LoopDetected: 508,
NotExtended: 510,
NetworkAuthenticationRequired: 511,
};
Object.entries(HttpStatusCode).forEach(([key, value]) => {
HttpStatusCode[value] = key;
});
const HttpStatusCode$1 = HttpStatusCode;
/** /**
* Create an instance of Axios * Create an instance of Axios
* *
@@ -3870,6 +3953,8 @@ axios.AxiosHeaders = AxiosHeaders$1;
axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing); axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
axios.HttpStatusCode = HttpStatusCode$1;
axios.default = axios; axios.default = axios;
module.exports = axios; module.exports = axios;
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
export const VERSION = "1.2.1"; export const VERSION = "1.2.2";
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "axios", "name": "axios",
"version": "1.2.1", "version": "1.2.2",
"description": "Promise based HTTP client for the browser and node.js", "description": "Promise based HTTP client for the browser and node.js",
"main": "index.js", "main": "index.js",
"exports": { "exports": {