From 640f0dd5e5f158639a51431cf0965da58c931a1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=40Siemienik=20Pawe=C5=82?= Date: Thu, 14 Jan 2021 12:12:40 +0100 Subject: [PATCH] Fixation propose https://github.com/Siemienik/XToolset/issues/93#issuecomment-760127980 --- src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 5dc0563..c0528e4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -96,7 +96,8 @@ export class GenerateXLSXFile { return workbook.xlsx.load(templateFileBuffer); }; - const result: Excel.Workbook = await this.renderer.render(templateFactory, this.viewModel); + const vmClone = JSON.parse(JSON.stringify(this.viewModel)); // workaround + const result: Excel.Workbook = await this.renderer.render(templateFactory, vmClone); const buffer: Excel.Buffer = await result.xlsx.writeBuffer() this.saveBlobToFile(new Blob([buffer]), `${Date.now()}_result_report.xlsx`); }