[BUG] `addRow` and `addRows` types broken in 4.1.0
See original GitHub issue🐛 Bug Report
v4.1.0
of the library broke the [TypeScript] types of addRow
and addRows
by requiring a second argument (styleOption
). This is however an optional argument.
Lib version: 4.1.0
Steps To Reproduce
const wb = new ExcelJS.Workbook();
const ws = wb.addWorksheet('blort');
ws.addRow([1]); // type error
The expected behaviour:
There should be no compilationn error, since the second argument is optional.
Possible solution (optional, but very helpful):
--- a/node_modules/exceljs/index.d.ts
+++ b/node_modules/exceljs/index.d.ts
@@ -1193,12 +1193,12 @@ export interface Worksheet {
* Add a couple of Rows by key-value, after the last current row, using the column keys,
* or add a row by contiguous Array (assign to columns A, B & C)
*/
- addRow(data: any[] | any, styleOption: string): Row;
+ addRow(data: any[] | any, styleOption?: string): Row;
/**
* Add multiple rows by providing an array of arrays or key-value pairs
*/
- addRows(rows: any[], styleOption: string): void;
+ addRows(rows: any[], styleOption?: string): void;
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:5 (3 by maintainers)
Top Results From Across the Web
APEX 4.1 : Problem with addRow Function — oracle-tech
The problem is that I Create a button called " Add Row" and into it I paste the ... When I run the...
Read more >exceljs - npm
Excel Workbook Manager - Read and Write xlsx and csv Files.. Latest version: 4.3.0, last published: a year ago. Start using exceljs in...
Read more >Add row in each group using dplyr and add_row()
(The new error message says "Cannot add rows to grouped data frames" , which answers your question of why it is not working.)...
Read more >Add rows to a data frame — add_row • tibble
This is a convenient way to add one or more rows of data to an existing data frame. See tribble() for an easy...
Read more >How to Add Row to DataFrame in R? - Spark by {Examples}
Add Rows by Not Changing Data Types. Use list() instead of a vector to add a row. Adding a list() as a row...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@guyonroche would you do the honours?
Looks to be fixed in 4.1.1. Closing. Thanks to everyone involved.