(data: any[], filename: string )
| 250 | |
| 251 | |
| 252 | async function writeExcel(data: any[], filename: string ): Promise<string> { |
| 253 | data = convertNestedToJsonForExcelInPlace(data) |
| 254 | |
| 255 | try { |
| 256 | |
| 257 | filename = fixExcelFilename(filename) |
| 258 | await writeWorkbook(data, filename) |
| 259 | |
| 260 | } catch (error) { |
| 261 | if (isFileOpenError(error)) { |
| 262 | const baseFilename = path.basename(filename) |
| 263 | throw new Error(`${baseFilename} is currently open in another application (e.g., Excel). Please close the application and try again.`) |
| 264 | } |
| 265 | throw error |
| 266 | } |
| 267 | return filename |
| 268 | } |
| 269 | |
| 270 | async function writeExcelStreamed(inputFileNamePath: any, filename: string, streamFn:any): Promise<string> { |
| 271 |
no test coverage detected