pdfkit-table
Advanced tools
Comparing version 0.1.98 to 0.1.99
36
index.js
@@ -404,3 +404,3 @@ // jshint esversion: 6 | ||
// (table width) 2o - Size defined | ||
options.width && ( w = String(options.width).replace(/[^0-9]/g,'') >> 0 ); | ||
options.width && ( w = parseInt(options.width) || String(options.width).replace(/[^0-9]/g,'') >> 0 ); | ||
@@ -931,16 +931,30 @@ // (table width) if table is percent of page | ||
async tables(tables, callback) { | ||
return new Promise((resolve, reject) => { | ||
return new Promise(async (resolve, reject) => { | ||
try { | ||
if(Array.isArray(tables) === false) | ||
{ | ||
resolve(); | ||
return; | ||
} | ||
const len = tables.length; | ||
for(let i; i < len; i++) | ||
{ | ||
await this.table(tables[i], tables[i].options || {}); | ||
} | ||
// if tables is Array | ||
Array.isArray(tables) ? | ||
// for each on Array | ||
tables.forEach( async table => await this.table( table, table.options || {} ) ) : | ||
// else is tables is a unique table object | ||
( typeof tables === 'object' ? this.table( tables, tables.options || {} ) : null ) ; | ||
// callback | ||
// Array.isArray(tables) ? | ||
// // for each on Array | ||
// tables.forEach( async table => await this.table( table, table.options || {} ) ) : | ||
// // else is tables is a unique table object | ||
// ( typeof tables === 'object' ? this.table( tables, tables.options || {} ) : null ) ; | ||
// // callback | ||
typeof callback === 'function' && callback(this); | ||
// donw! | ||
// // donw! | ||
resolve(); | ||
} catch (error) { | ||
} | ||
catch(error) | ||
{ | ||
reject(error); | ||
@@ -955,2 +969,2 @@ } | ||
module.exports = PDFDocumentWithTables; | ||
module.exports.default = PDFDocumentWithTables; | ||
module.exports.default = PDFDocumentWithTables; |
{ | ||
"name": "pdfkit-table", | ||
"version": "0.1.98", | ||
"version": "0.1.99", | ||
"description": "PdfKit Table. Helps to draw informations in simple tables using pdfkit. #server-side. Generate pdf tables with javascript (PDFKIT plugin) ", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -263,4 +263,4 @@ <p align="center"> | ||
| **headerAlign** | <code>String</code> | left | only header | | ||
| **columnColor** or backgroundColor | <code>String</code> | undefined | color of column | | ||
| **columnOpacity** or backgroundOpacity| <code>Number</code> | undefined | opacity of column | | ||
| **columnColor** or ~~backgroundColor~~ | <code>String</code> | undefined | color of column | | ||
| **columnOpacity** or ~~backgroundOpacity~~| <code>Number</code> | undefined | opacity of column | | ||
| **renderer** | <code>Function</code> | Function | function( value, indexColumn, indexRow, row, rectRow, rectCell ) { return value } | | ||
@@ -267,0 +267,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
56150
836