我尝试迭代 FormData Entry() 对象。ESlint 给了我错误,我真的不应该像下面那样做:
iterators/generators require regenerator-runtime, which is too heavyweight for this guide to allow them. Separately, loops should be avoided in favor of array iterations.
for (const row of data.entries()) {
const search = row[0].replace('internal_', '');
if (search.length > 0 && search.substr(1, 3) !== 'ext') {
currentCTX.data[search][2] = row[1];
}
const currentData = JSON.stringify(currentCTX.data);
const { feedId } = window;
const params = { userSave: currentData, id: parseInt(feedId, 10), channel: 'import' };
const res = fetchData(`${apiUrl}mapping`, params).then(() …Run Code Online (Sandbox Code Playgroud)