Compare commits

..

No commits in common. "master" and "2.1.7" have entirely different histories.

2 changed files with 5 additions and 14 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@bytedo/fetch", "name": "@bytedo/fetch",
"version": "2.1.8", "version": "2.1.7",
"description": "全新的ajax封装。分2个版本, 一个基于XMLHttpRequest, 一个基于window.fetch", "description": "全新的ajax封装。分2个版本, 一个基于XMLHttpRequest, 一个基于window.fetch",
"main": "dist/next.js", "main": "dist/next.js",
"files": [ "files": [

View File

@ -84,17 +84,13 @@ export const Format = {
mkFormData(data) { mkFormData(data) {
let form = new FormData() let form = new FormData()
for (let i in data) { for (let i in data) {
let val = data[i] let el = data[i]
if (val === void 0) { if (Array.isArray(el)) {
val = '' el.forEach(function (it) {
}
if (Array.isArray(val)) {
val.forEach(function (it) {
form.append(i + '[]', it) form.append(i + '[]', it)
}) })
} else { } else {
form.append(i, val) form.append(i, data[i])
} }
} }
return form return form
@ -109,11 +105,6 @@ export const Format = {
if (/native code/.test(v)) { if (/native code/.test(v)) {
return return
} }
if (v === void 0) {
v = ''
}
let _type = getType(v) let _type = getType(v)
v = typeof v === 'function' ? v() : v v = typeof v === 'function' ? v() : v