-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1842: New xlsx option for ignoring certain nodes for improved perform…
…ance (#2132) * 1842: New xlsx option for ignoring certain nodes for improved performance * Included test file * Added typescript typings * optimizing ifs * new line EOF * Update README.md - available options --------- Co-authored-by: Willem Le Roux <willemleroux@safeguardglobal.com> Co-authored-by: Siemienik Pawel <hi@siemienik.com>
- Loading branch information
1 parent
4abccf5
commit 3178efd
Showing
7 changed files
with
73 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
!*.xlsx |
Binary file not shown.
32 changes: 32 additions & 0 deletions
32
spec/integration/issues/issue-1842-dataValidations-memory-overload.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const {join} = require('path'); | ||
const {readFileSync} = require('fs'); | ||
|
||
const ExcelJS = verquire('exceljs'); | ||
|
||
const fileName = './spec/integration/data/test-issue-1842.xlsx'; | ||
|
||
describe('github issues', () => { | ||
describe('issue 1842 - Memory overload when unnecessary dataValidations apply', () => { | ||
it('when using readFile', async () => { | ||
const wb = new ExcelJS.Workbook(); | ||
await wb.xlsx.readFile(fileName, { | ||
ignoreNodes: ['dataValidations'], | ||
}); | ||
|
||
// arriving here is success | ||
expect(true).to.equal(true); | ||
}); | ||
|
||
it('when loading an in memory buffer', async () => { | ||
const filePath = join(process.cwd(), fileName); | ||
const buffer = readFileSync(filePath); | ||
const wb = new ExcelJS.Workbook(); | ||
await wb.xlsx.load(buffer, { | ||
ignoreNodes: ['dataValidations'], | ||
}); | ||
|
||
// arriving here is success | ||
expect(true).to.equal(true); | ||
}); | ||
}); | ||
}); |