2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-14 18:42:33 +03:00

Revert "Fixed isFormData predicate; (#4413)" (#4472)

This reverts commit 73e3bdb883.
This commit is contained in:
Jay
2022-02-13 15:47:38 +02:00
committed by GitHub
parent 447a24dfc3
commit d660e29c1a
6 changed files with 15 additions and 40 deletions
+3 -7
View File
@@ -1,7 +1,5 @@
'use strict';
var utils = require('../utils');
function combinedKey(parentKey, elKey) {
return parentKey + '.' + elKey;
}
@@ -13,7 +11,7 @@ function buildFormData(formData, data, parentKey) {
});
} else if (
typeof data === 'object' &&
!(utils.isFile(data) || data === null)
!(data instanceof File || data === null)
) {
Object.keys(data).forEach(function buildObject(key) {
buildFormData(
@@ -46,12 +44,10 @@ function buildFormData(formData, data, parentKey) {
* type FormVal = FormDataNest | FormDataPrimitive
*
* @param {FormVal} data
* @param {?Object} formData
*/
module.exports = function getFormData(data, formData) {
// eslint-disable-next-line no-param-reassign
formData = formData || new FormData();
module.exports = function getFormData(data) {
var formData = new FormData();
buildFormData(formData, data);