@grafosoft/excel-validator 1.0.9 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -24,7 +24,14 @@ const ExcelValidator = ({ initData, fileContent, matrix, validationErrors, onSel
|
|
|
24
24
|
return padded.join("|");
|
|
25
25
|
});
|
|
26
26
|
const content = lines.join("\n");
|
|
27
|
-
const
|
|
27
|
+
const bytes = new TextEncoder().encode(content);
|
|
28
|
+
const chunkSize = 8192;
|
|
29
|
+
let binary = "";
|
|
30
|
+
for (let offset = 0; offset < bytes.length; offset += chunkSize) {
|
|
31
|
+
const chunk = bytes.subarray(offset, offset + chunkSize);
|
|
32
|
+
binary += String.fromCharCode(...chunk);
|
|
33
|
+
}
|
|
34
|
+
const base64 = btoa(binary);
|
|
28
35
|
try {
|
|
29
36
|
const response = await fetch(`${initData.environment}api/v1/plains/upload?companyId=${initData.companyId}&apikey=${initData.apikey}`, {
|
|
30
37
|
method: "POST",
|