1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-07 12:30:06 +00:00

chore(file-upload-form): left comments

This commit is contained in:
Yury Shkoda
2023-07-11 09:26:36 +03:00
parent 6272eeda23
commit fe03faa59f

View File

@@ -27,14 +27,15 @@ export const generateFileUploadForm = (
)
}
// INFO: unfortunately it is not possible to check if formData is instance of NodeFormData or FormData because it will return true for both
if (isNode()) {
// environment is Node and formData is instance of NodeFormData
// INFO: environment is Node and formData is instance of NodeFormData
;(formData as NodeFormData).append(name, csv, {
filename: `${name}.csv`,
contentType: 'application/csv'
})
} else {
// environment is Browser and formData is instance of FormData
// INFO: environment is Browser and formData is instance of FormData
const file = new Blob([csv], {
type: 'application/csv'
})