2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-17 19:21:29 +03:00

URL params serializer; (#4734)

* Refactored BuildURL helper to use URLSearchParams serializer;

* Updated typings;
Added TS test;
This commit is contained in:
Dmitriy Mozgovoy
2022-05-25 09:16:38 +03:00
committed by GitHub
parent 467025bdb7
commit 934f390cc3
7 changed files with 84 additions and 87 deletions
+4
View File
@@ -46,6 +46,10 @@ function isSpecCompliant(thing) {
**/
function toFormData(obj, formData, options) {
if (!utils.isObject(obj)) {
throw new TypeError('target must be an object');
}
// eslint-disable-next-line no-param-reassign
formData = formData || new (envFormData || FormData)();