Skip to content

Commit

Permalink
Refactor createDocxBuffer function in officegenHelper.js
Browse files Browse the repository at this point in the history
  • Loading branch information
HlexNC committed Mar 29, 2024
1 parent 72a659f commit 9a737a3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions officegen-api/src/utils/officegenHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,13 @@ exports.createDocxBuffer = async (elements, styles) => {
docx.generate(bufferStream);

bufferStream.on('finish', () => {
console.log(bufferStream.getContents().length + ' bytes written to buffer.');
resolve(bufferStream.getContents());
});

bufferStream.on('error', (err) => {
console.error('Buffer stream error:', err);
reject(err);
});

bufferStream.end();
});
};

0 comments on commit 9a737a3

Please sign in to comment.