Skip to content

Commit

Permalink
Increase resilience to generating large workbooks (#2320)
Browse files Browse the repository at this point in the history
* Update xml-stream.js

Increase resilience to generating large workbooks
  • Loading branch information
hfhchan-plb committed Sep 19, 2023
1 parent 56a28e9 commit 804775a
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions lib/utils/xml-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,19 @@ const OPEN_ANGLE = '<';
const CLOSE_ANGLE = '>';
const OPEN_ANGLE_SLASH = '</';
const CLOSE_SLASH_ANGLE = '/>';
const EQUALS_QUOTE = '="';
const QUOTE = '"';
const SPACE = ' ';

function pushAttribute(xml, name, value) {
xml.push(SPACE);
xml.push(name);
xml.push(EQUALS_QUOTE);
xml.push(utils.xmlEncode(value.toString()));
xml.push(QUOTE);
xml.push(` ${name}="${utils.xmlEncode(value.toString())}"`);
}
function pushAttributes(xml, attributes) {
if (attributes) {
const tmp = [];
_.each(attributes, (value, name) => {
if (value !== undefined) {
pushAttribute(xml, name, value);
pushAttribute(tmp, name, value);
}
});
xml.push(tmp.join(""));
}
}

Expand Down

0 comments on commit 804775a

Please sign in to comment.