axios 1.2.1 → 1.2.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.

@@ -1,4 +1,4 @@
1
- // Axios v1.2.1 Copyright (c) 2022 Matt Zabriskie and contributors
1
+ // Axios v1.2.2 Copyright (c) 2022 Matt Zabriskie and contributors
2
2
  'use strict';
3
3
 
4
4
  function bind(fn, thisArg) {
@@ -282,7 +282,11 @@ function findKey(obj, key) {
282
282
  return null;
283
283
  }
284
284
 
285
- const _global = typeof self === "undefined" ? typeof global === "undefined" ? undefined : global : self;
285
+ const _global = (() => {
286
+ /*eslint no-undef:0*/
287
+ if (typeof globalThis !== "undefined") return globalThis;
288
+ return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global)
289
+ })();
286
290
 
287
291
  const isContextDefined = (context) => !isUndefined(context) && context !== _global;
288
292
 
@@ -1231,6 +1235,7 @@ const isStandardBrowserEnv = (() => {
1231
1235
  const isStandardBrowserWebWorkerEnv = (() => {
1232
1236
  return (
1233
1237
  typeof WorkerGlobalScope !== 'undefined' &&
1238
+ // eslint-disable-next-line no-undef
1234
1239
  self instanceof WorkerGlobalScope &&
1235
1240
  typeof self.importScripts === 'function'
1236
1241
  );
@@ -2577,7 +2582,7 @@ function mergeConfig(config1, config2) {
2577
2582
  return config;
2578
2583
  }
2579
2584
 
2580
- const VERSION = "1.2.1";
2585
+ const VERSION = "1.2.2";
2581
2586
 
2582
2587
  const validators$1 = {};
2583
2588
 
@@ -3009,6 +3014,78 @@ function isAxiosError(payload) {
3009
3014
  return utils.isObject(payload) && (payload.isAxiosError === true);
3010
3015
  }
3011
3016
 
3017
+ const HttpStatusCode = {
3018
+ Continue: 100,
3019
+ SwitchingProtocols: 101,
3020
+ Processing: 102,
3021
+ EarlyHints: 103,
3022
+ Ok: 200,
3023
+ Created: 201,
3024
+ Accepted: 202,
3025
+ NonAuthoritativeInformation: 203,
3026
+ NoContent: 204,
3027
+ ResetContent: 205,
3028
+ PartialContent: 206,
3029
+ MultiStatus: 207,
3030
+ AlreadyReported: 208,
3031
+ ImUsed: 226,
3032
+ MultipleChoices: 300,
3033
+ MovedPermanently: 301,
3034
+ Found: 302,
3035
+ SeeOther: 303,
3036
+ NotModified: 304,
3037
+ UseProxy: 305,
3038
+ Unused: 306,
3039
+ TemporaryRedirect: 307,
3040
+ PermanentRedirect: 308,
3041
+ BadRequest: 400,
3042
+ Unauthorized: 401,
3043
+ PaymentRequired: 402,
3044
+ Forbidden: 403,
3045
+ NotFound: 404,
3046
+ MethodNotAllowed: 405,
3047
+ NotAcceptable: 406,
3048
+ ProxyAuthenticationRequired: 407,
3049
+ RequestTimeout: 408,
3050
+ Conflict: 409,
3051
+ Gone: 410,
3052
+ LengthRequired: 411,
3053
+ PreconditionFailed: 412,
3054
+ PayloadTooLarge: 413,
3055
+ UriTooLong: 414,
3056
+ UnsupportedMediaType: 415,
3057
+ RangeNotSatisfiable: 416,
3058
+ ExpectationFailed: 417,
3059
+ ImATeapot: 418,
3060
+ MisdirectedRequest: 421,
3061
+ UnprocessableEntity: 422,
3062
+ Locked: 423,
3063
+ FailedDependency: 424,
3064
+ TooEarly: 425,
3065
+ UpgradeRequired: 426,
3066
+ PreconditionRequired: 428,
3067
+ TooManyRequests: 429,
3068
+ RequestHeaderFieldsTooLarge: 431,
3069
+ UnavailableForLegalReasons: 451,
3070
+ InternalServerError: 500,
3071
+ NotImplemented: 501,
3072
+ BadGateway: 502,
3073
+ ServiceUnavailable: 503,
3074
+ GatewayTimeout: 504,
3075
+ HttpVersionNotSupported: 505,
3076
+ VariantAlsoNegotiates: 506,
3077
+ InsufficientStorage: 507,
3078
+ LoopDetected: 508,
3079
+ NotExtended: 510,
3080
+ NetworkAuthenticationRequired: 511,
3081
+ };
3082
+
3083
+ Object.entries(HttpStatusCode).forEach(([key, value]) => {
3084
+ HttpStatusCode[value] = key;
3085
+ });
3086
+
3087
+ var HttpStatusCode$1 = HttpStatusCode;
3088
+
3012
3089
  /**
3013
3090
  * Create an instance of Axios
3014
3091
  *
@@ -3070,6 +3147,8 @@ axios.AxiosHeaders = AxiosHeaders$1;
3070
3147
 
3071
3148
  axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
3072
3149
 
3150
+ axios.HttpStatusCode = HttpStatusCode$1;
3151
+
3073
3152
  axios.default = axios;
3074
3153
 
3075
3154
  module.exports = axios;