@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 base64 = btoa(String.fromCharCode(...new TextEncoder().encode(content)));
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",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafosoft/excel-validator",
3
- "version": "1.0.9",
3
+ "version": "1.1.0",
4
4
  "description": "React component to validate Excel files against configurable JSON rules.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",