axios 0.28.0 → 0.28.1

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.
package/dist/esm/axios.js CHANGED
@@ -1,4 +1,4 @@
1
- // axios v0.28.0 Copyright (c) 2024 Matt Zabriskie
1
+ // axios v0.28.1 Copyright (c) 2024 Matt Zabriskie
2
2
  var bind = function bind(fn, thisArg) {
3
3
  return function wrap() {
4
4
  return fn.apply(thisArg, arguments);
@@ -869,12 +869,20 @@ var buildURL = function buildURL(url, params, options) {
869
869
 
870
870
  var _encode = options && options.encode || encode;
871
871
 
872
- var serializerParams = utils.isURLSearchParams(params) ?
873
- params.toString() :
874
- new AxiosURLSearchParams_1(params, options).toString(_encode);
872
+ var serializeFn = options && options.serialize;
875
873
 
876
- if (serializerParams) {
877
- url += (url.indexOf('?') === -1 ? '?' : '&') + serializerParams;
874
+ var serializedParams;
875
+
876
+ if (serializeFn) {
877
+ serializedParams = serializeFn(params, options);
878
+ } else {
879
+ serializedParams = utils.isURLSearchParams(params) ?
880
+ params.toString() :
881
+ new AxiosURLSearchParams_1(params, options).toString(_encode);
882
+ }
883
+
884
+ if (serializedParams) {
885
+ url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
878
886
  }
879
887
 
880
888
  return url;
@@ -1489,7 +1497,7 @@ var xhr = function xhrAdapter(config) {
1489
1497
  if (!request) {
1490
1498
  return;
1491
1499
  }
1492
- reject(!cancel || cancel.type ? new CanceledError_1(null, config, req) : cancel);
1500
+ reject(!cancel || cancel.type ? new CanceledError_1(null, config, request) : cancel);
1493
1501
  request.abort();
1494
1502
  request = null;
1495
1503
  };
@@ -1893,7 +1901,7 @@ var mergeConfig = function mergeConfig(config1, config2) {
1893
1901
  };
1894
1902
 
1895
1903
  var data = {
1896
- "version": "0.28.0"
1904
+ "version": "0.28.1"
1897
1905
  };
1898
1906
 
1899
1907
  var VERSION = data.version;
@@ -2034,6 +2042,13 @@ Axios.prototype.request = function request(configOrUrl, config) {
2034
2042
 
2035
2043
  var paramsSerializer = config.paramsSerializer;
2036
2044
 
2045
+ if (paramsSerializer !== undefined) {
2046
+ validator.assertOptions(paramsSerializer, {
2047
+ encode: validators.function,
2048
+ serialize: validators.function
2049
+ }, true);
2050
+ }
2051
+
2037
2052
  utils.isFunction(paramsSerializer) && (config.paramsSerializer = {serialize: paramsSerializer});
2038
2053
 
2039
2054
  // filter out skipped interceptors