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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.28.1](https://github.com/axios/axios/compare/v0.28.0...v0.28.1) (2024-03-24)
4
+
5
+ ## Release notes:
6
+ ### Bug Fixes
7
+
8
+ * fix(backport): custom params serializer support (#6263)
9
+ * fix(backport): uncaught ReferenceError `req` is not defined (#6307)
10
+
3
11
  ## [0.28.0](https://github.com/axios/axios/compare/v0.27.2...v0.28.0) (2024-02-12)
4
12
 
5
13
  ## Release notes:
package/dist/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
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
4
4
  typeof define === 'function' && define.amd ? define(factory) :
@@ -875,12 +875,20 @@
875
875
 
876
876
  var _encode = options && options.encode || encode;
877
877
 
878
- var serializerParams = utils.isURLSearchParams(params) ?
879
- params.toString() :
880
- new AxiosURLSearchParams_1(params, options).toString(_encode);
878
+ var serializeFn = options && options.serialize;
881
879
 
882
- if (serializerParams) {
883
- url += (url.indexOf('?') === -1 ? '?' : '&') + serializerParams;
880
+ var serializedParams;
881
+
882
+ if (serializeFn) {
883
+ serializedParams = serializeFn(params, options);
884
+ } else {
885
+ serializedParams = utils.isURLSearchParams(params) ?
886
+ params.toString() :
887
+ new AxiosURLSearchParams_1(params, options).toString(_encode);
888
+ }
889
+
890
+ if (serializedParams) {
891
+ url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
884
892
  }
885
893
 
886
894
  return url;
@@ -1495,7 +1503,7 @@
1495
1503
  if (!request) {
1496
1504
  return;
1497
1505
  }
1498
- reject(!cancel || cancel.type ? new CanceledError_1(null, config, req) : cancel);
1506
+ reject(!cancel || cancel.type ? new CanceledError_1(null, config, request) : cancel);
1499
1507
  request.abort();
1500
1508
  request = null;
1501
1509
  };
@@ -1899,7 +1907,7 @@
1899
1907
  };
1900
1908
 
1901
1909
  var data = {
1902
- "version": "0.28.0"
1910
+ "version": "0.28.1"
1903
1911
  };
1904
1912
 
1905
1913
  var VERSION = data.version;
@@ -2040,6 +2048,13 @@
2040
2048
 
2041
2049
  var paramsSerializer = config.paramsSerializer;
2042
2050
 
2051
+ if (paramsSerializer !== undefined) {
2052
+ validator.assertOptions(paramsSerializer, {
2053
+ encode: validators.function,
2054
+ serialize: validators.function
2055
+ }, true);
2056
+ }
2057
+
2043
2058
  utils.isFunction(paramsSerializer) && (config.paramsSerializer = {serialize: paramsSerializer});
2044
2059
 
2045
2060
  // filter out skipped interceptors