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/lib/core/Axios.js CHANGED
@@ -61,6 +61,13 @@ Axios.prototype.request = function request(configOrUrl, config) {
61
61
 
62
62
  var paramsSerializer = config.paramsSerializer;
63
63
 
64
+ if (paramsSerializer !== undefined) {
65
+ validator.assertOptions(paramsSerializer, {
66
+ encode: validators.function,
67
+ serialize: validators.function
68
+ }, true);
69
+ }
70
+
64
71
  utils.isFunction(paramsSerializer) && (config.paramsSerializer = {serialize: paramsSerializer});
65
72
 
66
73
  // filter out skipped interceptors
package/lib/env/data.js CHANGED
@@ -1,3 +1,3 @@
1
1
  module.exports = {
2
- "version": "0.28.0"
2
+ "version": "0.28.1"
3
3
  };
@@ -35,12 +35,20 @@ module.exports = function buildURL(url, params, options) {
35
35
 
36
36
  var _encode = options && options.encode || encode;
37
37
 
38
- var serializerParams = utils.isURLSearchParams(params) ?
39
- params.toString() :
40
- new AxiosURLSearchParams(params, options).toString(_encode);
38
+ var serializeFn = options && options.serialize;
41
39
 
42
- if (serializerParams) {
43
- url += (url.indexOf('?') === -1 ? '?' : '&') + serializerParams;
40
+ var serializedParams;
41
+
42
+ if (serializeFn) {
43
+ serializedParams = serializeFn(params, options);
44
+ } else {
45
+ serializedParams = utils.isURLSearchParams(params) ?
46
+ params.toString() :
47
+ new AxiosURLSearchParams(params, options).toString(_encode);
48
+ }
49
+
50
+ if (serializedParams) {
51
+ url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
44
52
  }
45
53
 
46
54
  return url;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "axios",
3
- "version": "0.28.0",
3
+ "version": "0.28.1",
4
4
  "description": "Promise based HTTP client for the browser and node.js",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",