From e12c1e59acd5fc66ec274395f3c0f88713daf5b4 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 28 May 2023 19:16:44 +0100 Subject: Add toArrayBuffer when embedding a style map --- lib/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib/index.js') diff --git a/lib/index.js b/lib/index.js index ac9f634..03302c2 100644 --- a/lib/index.js +++ b/lib/index.js @@ -92,12 +92,15 @@ function embedStyleMap(input, styleMap) { return docxStyleMap.writeStyleMap(docxFile, styleMap); }) .then(function(docxFile) { - return docxFile.toBuffer(); + return docxFile.toArrayBuffer(); }) - .then(function(buffer) { + .then(function(arrayBuffer) { return { + toArrayBuffer: function() { + return arrayBuffer; + }, toBuffer: function() { - return buffer; + return Buffer.from(arrayBuffer); } }; }); -- cgit v1.2.3