axios 1.0.0 → 1.1.0

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/index.d.ts CHANGED
@@ -210,10 +210,10 @@ export interface TransitionalOptions {
210
210
  }
211
211
 
212
212
  export interface GenericAbortSignal {
213
- aborted: boolean;
214
- onabort: ((...args: any) => any) | null;
215
- addEventListener: (...args: any) => any;
216
- removeEventListener: (...args: any) => any;
213
+ readonly aborted: boolean;
214
+ onabort?: ((...args: any) => any) | null;
215
+ addEventListener?: (...args: any) => any;
216
+ removeEventListener?: (...args: any) => any;
217
217
  }
218
218
 
219
219
  export interface FormDataVisitorHelpers {
@@ -413,6 +413,7 @@ export interface AxiosInterceptorOptions {
413
413
  export interface AxiosInterceptorManager<V> {
414
414
  use(onFulfilled?: (value: V) => V | Promise<V>, onRejected?: (error: any) => any, options?: AxiosInterceptorOptions): number;
415
415
  eject(id: number): void;
416
+ clear(): void;
416
417
  }
417
418
 
418
419
  export class Axios {
@@ -301,9 +301,14 @@ export default function httpAdapter(config) {
301
301
 
302
302
  auth && headers.delete('authorization');
303
303
 
304
- const path = parsed.pathname.concat(parsed.searchParams);
304
+ let path;
305
+
305
306
  try {
306
- buildURL(path, config.params, config.paramsSerializer).replace(/^\?/, '');
307
+ path = buildURL(
308
+ parsed.pathname + parsed.search,
309
+ config.params,
310
+ config.paramsSerializer
311
+ ).replace(/^\?/, '');
307
312
  } catch (err) {
308
313
  const customErr = new Error(err.message);
309
314
  customErr.config = config;
@@ -315,7 +320,7 @@ export default function httpAdapter(config) {
315
320
  headers.set('Accept-Encoding', 'gzip, deflate, br', false);
316
321
 
317
322
  const options = {
318
- path: buildURL(path, config.params, config.paramsSerializer).replace(/^\?/, ''),
323
+ path,
319
324
  method: method,
320
325
  headers: headers.toJSON(),
321
326
  agents: { http: config.httpAgent, https: config.httpsAgent },
package/lib/axios.js CHANGED
@@ -7,13 +7,15 @@ import mergeConfig from './core/mergeConfig.js';
7
7
  import defaults from './defaults/index.js';
8
8
  import formDataToJSON from './helpers/formDataToJSON.js';
9
9
  import CanceledError from './cancel/CanceledError.js';
10
- import CancelToken from'./cancel/CancelToken.js';
11
- import isCancel from'./cancel/isCancel.js';
10
+ import CancelToken from './cancel/CancelToken.js';
11
+ import isCancel from './cancel/isCancel.js';
12
12
  import {VERSION} from './env/data.js';
13
13
  import toFormData from './helpers/toFormData.js';
14
14
  import AxiosError from './core/AxiosError.js';
15
15
  import spread from './helpers/spread.js';
16
16
  import isAxiosError from './helpers/isAxiosError.js';
17
+ import AxiosHeaders from './core/AxiosHeaders.js';
18
+
17
19
 
18
20
  /**
19
21
  * Create an instance of Axios
@@ -73,4 +75,10 @@ axios.formToJSON = thing => {
73
75
  return formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
74
76
  };
75
77
 
76
- export default axios;
78
+ export {
79
+ axios as default,
80
+ Axios,
81
+ AxiosHeaders,
82
+ AxiosError,
83
+ CanceledError,
84
+ };
package/lib/env/data.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "1.0.0";
1
+ export const VERSION = "1.1.0";
package/lib/utils.js CHANGED
@@ -132,7 +132,7 @@ const isPlainObject = (val) => {
132
132
  }
133
133
 
134
134
  const prototype = getPrototypeOf(val);
135
- return prototype === null || prototype === Object.prototype;
135
+ return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
136
136
  }
137
137
 
138
138
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "axios",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Promise based HTTP client for the browser and node.js",
5
5
  "main": "index.js",
6
6
  "exports": {
package/rollup.config.js CHANGED
@@ -56,7 +56,7 @@ export default async () => {
56
56
  file: `dist/${outputFileName}`,
57
57
  name,
58
58
  format: "umd",
59
- exports: "default",
59
+ exports: "named",
60
60
  banner
61
61
  }
62
62
  }),
@@ -77,7 +77,7 @@ export default async () => {
77
77
  file: `dist/node/${name}.cjs`,
78
78
  format: "cjs",
79
79
  preferConst: true,
80
- exports: "default",
80
+ exports: "named",
81
81
  banner
82
82
  },
83
83
  plugins: [