From fe03faa59f1192d0450e0fde9593b920ffa2a2ff Mon Sep 17 00:00:00 2001 From: Yury Shkoda Date: Tue, 11 Jul 2023 09:26:36 +0300 Subject: [PATCH] chore(file-upload-form): left comments --- src/file/generateFileUploadForm.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/file/generateFileUploadForm.ts b/src/file/generateFileUploadForm.ts index efb4792..75da2c6 100644 --- a/src/file/generateFileUploadForm.ts +++ b/src/file/generateFileUploadForm.ts @@ -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' })