Skip to content

Commit

Permalink
fix: should not create blob in node
Browse files Browse the repository at this point in the history
  • Loading branch information
sabhas committed Mar 23, 2022
1 parent 256e4ef commit d0eb1a7
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/file/generateFileUploadForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,18 @@ export const generateFileUploadForm = (
)
}

const file = new Blob([csv], {
type: 'application/csv'
})
if (typeof FormData === 'undefined' && formData instanceof NodeFormData) {
formData.append(name, csv, {
filename: `${name}.csv`,
contentType: 'application/csv'
})
} else {
const file = new Blob([csv], {
type: 'application/csv'
})

formData.append(name, file, `${name}.csv`)
formData.append(name, file, `${name}.csv`)
}
}

return formData
Expand Down

1 comment on commit d0eb1a7

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage report

Total coverage

Status Category Percentage Covered / Total
🟡 Statements 60.03% 1763/2937
🔴 Branches 40.74% 620/1522
🔴 Functions 46.98% 249/530
🟡 Lines 68.69% 2812/4094

Status of coverage: 🟢 - ok, 🟡 - slightly more than threshold, 🔴 - under the threshold

Report generated by 🧪jest coverage report action from d0eb1a7

Please sign in to comment.