@flowaccount/pdfmake 1.0.6 → 1.0.7-staging.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowaccount/pdfmake",
3
- "version": "1.0.6",
3
+ "version": "1.0.7-staging.0",
4
4
  "description": "Client/server side PDF printing in pure JavaScript",
5
5
  "main": "src/printer.js",
6
6
  "browser": "build/pdfmake.js",
@@ -44,12 +44,10 @@ TableProcessor.prototype.beginTable = function (writer) {
44
44
  var headerRows = tableNode.table.headerRows;
45
45
 
46
46
  if (isPositiveInteger(headerRows)) {
47
- // Fix: If headerRows exceeds available rows, adjust to match body length
48
- // This prevents errors when tables have empty bodies
49
- if (headerRows > tableNode.table.body.length) {
50
- this.headerRows = tableNode.table.body.length;
51
- } else {
52
- this.headerRows = headerRows;
47
+ this.headerRows = headerRows;
48
+
49
+ if (this.headerRows > tableNode.table.body.length) {
50
+ throw new Error(`Too few rows in the table. Property headerRows requires at least ${this.headerRows}, contains only ${tableNode.table.body.length}`);
53
51
  }
54
52
 
55
53
  this.rowsWithoutPageBreak = this.headerRows;