Function
writeWorkbookBase
(filename:string, exec:(x:any)=>void)
Source from the content-addressed store, hash-verified
| 434 | } |
| 435 | |
| 436 | async function writeWorkbookBase(filename:string, exec:(x:any)=>void) { |
| 437 | const workbook = new ExcelJS.stream.xlsx.WorkbookWriter({ |
| 438 | filename: filename, |
| 439 | }); |
| 440 | const worksheet = workbook.addWorksheet('Sheet1'); |
| 441 | |
| 442 | exec(worksheet) |
| 443 | |
| 444 | await workbook.commit(); |
| 445 | |
| 446 | return filename |
| 447 | } |
| 448 | |
| 449 | async function writeWorkbook(data: any[], filename: string){ |
| 450 | return writeWorkbookBase(filename, (worksheet:any) =>{ |
Tested by
no test coverage detected