Closed sandervanhooft closed 7 years ago
Ok, just found out that FormData() is a browser function. See here. So the code example was already complete.
Nevertheless, it still yields the ESLint guard-for-in
warning. Any thoughts on that?
Fixed the guard-for-in
warning. Simply check within the for-in loop for the value k
:
...
for (var k in value) {
if(k) { // fixes guard-for-in warning from ESLint
var v = value[k]
if (t.form.File.is(v)) {
fd.append(k, v, v.name)
} else {
fd.append(k, v)
}
}
}
...
Version
Tell us which versions you are using:
Expected behaviour
File should be uploaded using the example code from #112. It however seems to be incomplete. Is there a complete and working example available? This is what @gcanti has included in #112:
Actual behaviour
I can't deduce what the
new FormData()
is or where it should be imported from. Additionally, the for-in loop used in the example throws aguard-for-in
esLint warning.