2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-15 11:59:42 +03:00

fix: allow passing a callback as paramsSerializer to buildURL (#6680)

* fix: allow passing a callback as paramsSerializer to buildURL

* fix: add missing semicolon
This commit is contained in:
Tommaso Paulon
2024-11-12 16:33:33 +01:00
committed by GitHub
parent df956d18fe
commit eac4619fe2
2 changed files with 14 additions and 1 deletions
+7 -1
View File
@@ -26,7 +26,7 @@ function encode(val) {
*
* @param {string} url The base of the url (e.g., http://www.google.com)
* @param {object} [params] The params to be appended
* @param {?object} options
* @param {?(object|Function)} options
*
* @returns {string} The formatted url
*/
@@ -38,6 +38,12 @@ export default function buildURL(url, params, options) {
const _encode = options && options.encode || encode;
if (utils.isFunction(options)) {
options = {
serialize: options
};
}
const serializeFn = options && options.serialize;
let serializedParams;