@js-ak/excel-toolbox 1.4.0 → 1.4.1

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.
Files changed (29) hide show
  1. package/build/cjs/lib/template/template-fs.js +4 -223
  2. package/build/cjs/lib/template/utils/extract-xml-declaration.js +1 -1
  3. package/build/cjs/lib/template/utils/get-max-row-number.js +1 -1
  4. package/build/cjs/lib/template/utils/index.js +4 -0
  5. package/build/cjs/lib/template/utils/process-merge-cells.js +40 -0
  6. package/build/cjs/lib/template/utils/process-merge-finalize.js +51 -0
  7. package/build/cjs/lib/template/utils/process-rows.js +160 -0
  8. package/build/cjs/lib/template/utils/process-shared-strings.js +45 -0
  9. package/build/cjs/lib/template/utils/to-excel-column-object.js +2 -10
  10. package/build/cjs/lib/template/utils/validate-worksheet-xml.js +65 -51
  11. package/build/cjs/lib/template/utils/write-rows-to-stream.js +2 -1
  12. package/build/esm/lib/template/template-fs.js +4 -223
  13. package/build/esm/lib/template/utils/extract-xml-declaration.js +1 -1
  14. package/build/esm/lib/template/utils/get-max-row-number.js +1 -1
  15. package/build/esm/lib/template/utils/index.js +4 -0
  16. package/build/esm/lib/template/utils/process-merge-cells.js +37 -0
  17. package/build/esm/lib/template/utils/process-merge-finalize.js +48 -0
  18. package/build/esm/lib/template/utils/process-rows.js +157 -0
  19. package/build/esm/lib/template/utils/process-shared-strings.js +42 -0
  20. package/build/esm/lib/template/utils/to-excel-column-object.js +2 -10
  21. package/build/esm/lib/template/utils/validate-worksheet-xml.js +65 -51
  22. package/build/esm/lib/template/utils/write-rows-to-stream.js +2 -1
  23. package/build/types/lib/template/utils/index.d.ts +4 -0
  24. package/build/types/lib/template/utils/process-merge-cells.d.ts +20 -0
  25. package/build/types/lib/template/utils/process-merge-finalize.d.ts +38 -0
  26. package/build/types/lib/template/utils/process-rows.d.ts +31 -0
  27. package/build/types/lib/template/utils/process-shared-strings.d.ts +20 -0
  28. package/build/types/lib/template/utils/validate-worksheet-xml.d.ts +16 -0
  29. package/package.json +1 -1
@@ -5,5 +5,21 @@ interface ValidationResult {
5
5
  details?: string;
6
6
  };
7
7
  }
8
+ /**
9
+ * Validates an Excel worksheet XML against the expected structure and rules.
10
+ *
11
+ * Checks the following:
12
+ * 1. XML starts with <?xml declaration
13
+ * 2. Root element is worksheet
14
+ * 3. Required elements are present
15
+ * 4. row numbers are in ascending order
16
+ * 5. No duplicate row numbers
17
+ * 6. No overlapping merge ranges
18
+ * 7. All cells are within the specified dimension
19
+ * 8. All mergeCell tags refer to existing cells
20
+ *
21
+ * @param xml The raw XML content of the worksheet
22
+ * @returns A ValidationResult object indicating if the XML is valid, and an error message if it's not
23
+ */
8
24
  export declare function validateWorksheetXml(xml: string): ValidationResult;
9
25
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@js-ak/excel-toolbox",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "excel-toolbox",
5
5
  "publishConfig": {
6
6
  "access": "public",